From 49d217385f144f452ba3bc3ca5bfd2857c9e11e7 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Thu, 25 May 2023 22:59:41 +0000 Subject: [PATCH 1/2] feat: [rapidmigrationassessment] new module for rapidmigrationassessment --- gapic-libraries-bom/pom.xml | 7 + java-rapidmigrationassessment/.OwlBot.yaml | 36 + .../.repo-metadata.json | 16 + java-rapidmigrationassessment/README.md | 225 + .../pom.xml | 44 + .../pom.xml | 113 + .../v1/RapidMigrationAssessmentClient.java | 2029 +++++++++ .../v1/RapidMigrationAssessmentSettings.java | 429 ++ .../v1/gapic_metadata.json | 54 + .../v1/package-info.java | 44 + ...pidMigrationAssessmentCallableFactory.java | 113 + .../GrpcRapidMigrationAssessmentStub.java | 635 +++ ...pidMigrationAssessmentCallableFactory.java | 105 + .../HttpJsonRapidMigrationAssessmentStub.java | 981 +++++ .../v1/stub/RapidMigrationAssessmentStub.java | 160 + .../RapidMigrationAssessmentStubSettings.java | 1072 +++++ .../v1/MockLocations.java | 59 + .../v1/MockLocationsImpl.java | 105 + .../v1/MockRapidMigrationAssessment.java | 59 + .../v1/MockRapidMigrationAssessmentImpl.java | 271 ++ ...MigrationAssessmentClientHttpJsonTest.java | 1344 ++++++ .../RapidMigrationAssessmentClientTest.java | 1236 ++++++ .../pom.xml | 45 + .../v1/RapidMigrationAssessmentGrpc.java | 1459 +++++++ java-rapidmigrationassessment/owlbot.py | 36 + java-rapidmigrationassessment/pom.xml | 53 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 37 + .../v1/Annotation.java | 1801 ++++++++ .../v1/AnnotationName.java | 223 + .../v1/AnnotationOrBuilder.java | 209 + .../v1/ApiEntitiesProto.java | 204 + .../v1/Collector.java | 3831 +++++++++++++++++ .../v1/CollectorName.java | 223 + .../v1/CollectorOrBuilder.java | 473 ++ .../v1/CreateAnnotationRequest.java | 1090 +++++ .../v1/CreateAnnotationRequestOrBuilder.java | 120 + .../v1/CreateCollectorRequest.java | 1271 ++++++ .../v1/CreateCollectorRequestOrBuilder.java | 145 + .../v1/DeleteCollectorRequest.java | 883 ++++ .../v1/DeleteCollectorRequestOrBuilder.java | 103 + .../v1/GetAnnotationRequest.java | 615 +++ .../v1/GetAnnotationRequestOrBuilder.java | 54 + .../v1/GetCollectorRequest.java | 613 +++ .../v1/GetCollectorRequestOrBuilder.java | 54 + .../v1/GuestOsScan.java | 592 +++ .../v1/GuestOsScanOrBuilder.java | 50 + .../v1/ListCollectorsRequest.java | 1260 ++++++ .../v1/ListCollectorsRequestOrBuilder.java | 143 + .../v1/ListCollectorsResponse.java | 1387 ++++++ .../v1/ListCollectorsResponseOrBuilder.java | 153 + .../v1/LocationName.java | 192 + .../v1/OperationMetadata.java | 1802 ++++++++ .../v1/OperationMetadataOrBuilder.java | 218 + .../v1/PauseCollectorRequest.java | 883 ++++ .../v1/PauseCollectorRequestOrBuilder.java | 103 + .../v1/RapidMigrationAssessmentProto.java | 350 ++ .../v1/RegisterCollectorRequest.java | 883 ++++ .../v1/RegisterCollectorRequestOrBuilder.java | 103 + .../v1/ResumeCollectorRequest.java | 883 ++++ .../v1/ResumeCollectorRequestOrBuilder.java | 103 + .../v1/UpdateCollectorRequest.java | 1297 ++++++ .../v1/UpdateCollectorRequestOrBuilder.java | 165 + .../v1/VSphereScan.java | 592 +++ .../v1/VSphereScanOrBuilder.java | 50 + .../v1/api_entities.proto | 171 + .../v1/rapidmigrationassessment.proto | 421 ++ .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncCreateAnnotation.java | 54 + .../AsyncCreateAnnotationLRO.java | 54 + .../SyncCreateAnnotation.java | 49 + ...reateAnnotationLocationnameAnnotation.java | 45 + .../SyncCreateAnnotationStringAnnotation.java | 45 + .../createcollector/AsyncCreateCollector.java | 55 + .../AsyncCreateCollectorLRO.java | 55 + .../createcollector/SyncCreateCollector.java | 50 + ...eCollectorLocationnameCollectorString.java | 46 + ...cCreateCollectorStringCollectorString.java | 46 + .../deletecollector/AsyncDeleteCollector.java | 52 + .../AsyncDeleteCollectorLRO.java | 53 + .../deletecollector/SyncDeleteCollector.java | 48 + .../SyncDeleteCollectorCollectorname.java | 43 + .../SyncDeleteCollectorString.java | 43 + .../getannotation/AsyncGetAnnotation.java | 51 + .../getannotation/SyncGetAnnotation.java | 47 + .../SyncGetAnnotationAnnotationname.java | 43 + .../SyncGetAnnotationString.java | 43 + .../getcollector/AsyncGetCollector.java | 51 + .../getcollector/SyncGetCollector.java | 47 + .../SyncGetCollectorCollectorname.java | 43 + .../getcollector/SyncGetCollectorString.java | 43 + .../getlocation/AsyncGetLocation.java | 47 + .../getlocation/SyncGetLocation.java | 43 + .../listcollectors/AsyncListCollectors.java | 57 + .../AsyncListCollectorsPaged.java | 65 + .../listcollectors/SyncListCollectors.java | 54 + .../SyncListCollectorsLocationname.java | 45 + .../SyncListCollectorsString.java | 45 + .../listlocations/AsyncListLocations.java | 55 + .../AsyncListLocationsPaged.java | 63 + .../listlocations/SyncListLocations.java | 51 + .../pausecollector/AsyncPauseCollector.java | 52 + .../AsyncPauseCollectorLRO.java | 53 + .../pausecollector/SyncPauseCollector.java | 48 + .../SyncPauseCollectorCollectorname.java | 43 + .../SyncPauseCollectorString.java | 43 + .../AsyncRegisterCollector.java | 52 + .../AsyncRegisterCollectorLRO.java | 53 + .../SyncRegisterCollector.java | 48 + .../SyncRegisterCollectorCollectorname.java | 43 + .../SyncRegisterCollectorString.java | 43 + .../resumecollector/AsyncResumeCollector.java | 52 + .../AsyncResumeCollectorLRO.java | 53 + .../resumecollector/SyncResumeCollector.java | 48 + .../SyncResumeCollectorCollectorname.java | 43 + .../SyncResumeCollectorString.java | 43 + .../updatecollector/AsyncUpdateCollector.java | 54 + .../AsyncUpdateCollectorLRO.java | 54 + .../updatecollector/SyncUpdateCollector.java | 49 + ...SyncUpdateCollectorCollectorFieldmask.java | 45 + .../getannotation/SyncGetAnnotation.java | 50 + .../getannotation/SyncGetAnnotation.java | 50 + pom.xml | 1 + versions.txt | 3 + 126 files changed, 37281 insertions(+) create mode 100644 java-rapidmigrationassessment/.OwlBot.yaml create mode 100644 java-rapidmigrationassessment/.repo-metadata.json create mode 100644 java-rapidmigrationassessment/README.md create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClient.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentSettings.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/gapic_metadata.json create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/package-info.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentCallableFactory.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentStub.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentCallableFactory.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentStub.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStub.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStubSettings.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockLocations.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockLocationsImpl.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessment.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessmentImpl.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientHttpJsonTest.java create mode 100644 java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientTest.java create mode 100644 java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/pom.xml create mode 100644 java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentGrpc.java create mode 100644 java-rapidmigrationassessment/owlbot.py create mode 100644 java-rapidmigrationassessment/pom.xml create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/clirr-ignored-differences.xml create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/pom.xml create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Annotation.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationName.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ApiEntitiesProto.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Collector.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorName.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScan.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScanOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponse.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponseOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/LocationName.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadata.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadataOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentProto.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequest.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequestOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScan.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScanOrBuilder.java create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/api_entities.proto create mode 100644 java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetEndpoint.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotationLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationLocationnameAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationStringAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollectorLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorLocationnameCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorStringCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollectorLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorCollectorname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/AsyncGetAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationAnnotationname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/AsyncGetCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorCollectorname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/AsyncGetLocation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/SyncGetLocation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectors.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectorsPaged.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectors.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsLocationname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocations.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocationsPaged.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/SyncListLocations.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollectorLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorCollectorname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollectorLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorCollectorname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollectorLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorCollectorname.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorString.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollectorLRO.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollector.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollectorCollectorFieldmask.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessmentsettings/getannotation/SyncGetAnnotation.java create mode 100644 java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/stub/rapidmigrationassessmentstubsettings/getannotation/SyncGetAnnotation.java diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 35c90c553abe..fa8eb4277683 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -777,6 +777,13 @@ pom import + + com.google.cloud + google-cloud-rapidmigrationassessment-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-recaptchaenterprise-bom diff --git a/java-rapidmigrationassessment/.OwlBot.yaml b/java-rapidmigrationassessment/.OwlBot.yaml new file mode 100644 index 000000000000..6ebc94376c5c --- /dev/null +++ b/java-rapidmigrationassessment/.OwlBot.yaml @@ -0,0 +1,36 @@ +# 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. + + +deep-remove-regex: +- "/java-rapidmigrationassessment/grpc-google-.*/src" +- "/java-rapidmigrationassessment/proto-google-.*/src" +- "/java-rapidmigrationassessment/google-.*/src" +- "/java-rapidmigrationassessment/samples/snippets/generated" + +deep-preserve-regex: +- "/java-rapidmigrationassessment/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/rapidmigrationassessment/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-rapidmigrationassessment/$1/proto-google-cloud-rapidmigrationassessment-$1/src" +- source: "/google/cloud/rapidmigrationassessment/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-rapidmigrationassessment/$1/grpc-google-cloud-rapidmigrationassessment-$1/src" +- source: "/google/cloud/rapidmigrationassessment/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-rapidmigrationassessment/$1/google-cloud-rapidmigrationassessment/src" +- source: "/google/cloud/rapidmigrationassessment/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-rapidmigrationassessment/$1/samples/snippets/generated" + + +api-name: rapidmigrationassessment \ No newline at end of file diff --git a/java-rapidmigrationassessment/.repo-metadata.json b/java-rapidmigrationassessment/.repo-metadata.json new file mode 100644 index 000000000000..f6326508abdd --- /dev/null +++ b/java-rapidmigrationassessment/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "rapidmigrationassessment", + "name_pretty": "Rapid Migration Assessment API", + "product_documentation": "https://cloud.google.com/migration-center/docs", + "api_description": "Rapid Migration Assessment API", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-rapidmigrationassessment/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-rapidmigrationassessment", + "repo_short": "java-rapidmigrationassessment", + "distribution_name": "com.google.cloud:google-cloud-rapidmigrationassessment", + "api_id": "rapidmigrationassessment.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-rapidmigrationassessment/README.md b/java-rapidmigrationassessment/README.md new file mode 100644 index 000000000000..2aa353ba9d36 --- /dev/null +++ b/java-rapidmigrationassessment/README.md @@ -0,0 +1,225 @@ +# Google Rapid Migration Assessment API Client for Java + +Java idiomatic client for [Rapid Migration Assessment API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.15.0 + pom + import + + + + + + + com.google.cloud + google-cloud-rapidmigrationassessment + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-rapidmigrationassessment + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-rapidmigrationassessment:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-rapidmigrationassessment" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Rapid Migration Assessment API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Rapid Migration Assessment API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Rapid Migration Assessment API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Rapid Migration Assessment API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-rapidmigrationassessment` library. See the [Quickstart](#quickstart) section +to add `google-cloud-rapidmigrationassessment` as a dependency in your code. + +## About Rapid Migration Assessment API + + +[Rapid Migration Assessment API][product-docs] Rapid Migration Assessment API + +See the [Rapid Migration Assessment API client library docs][javadocs] to learn how to +use this Rapid Migration Assessment API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Rapid Migration Assessment API uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/migration-center/docs +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-rapidmigrationassessment/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-rapidmigrationassessment/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-rapidmigrationassessment.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-rapidmigrationassessment/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-rapidmigrationassessment/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-rapidmigrationassessment/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-rapidmigrationassessment/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=rapidmigrationassessment.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml new file mode 100644 index 000000000000..55db8fb25397 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-rapidmigrationassessment-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.12.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Rapid Migration Assessment API BOM + + BOM for Rapid Migration Assessment API + + + + true + + + + + + com.google.cloud + google-cloud-rapidmigrationassessment + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-rapidmigrationassessment-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-rapidmigrationassessment-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml new file mode 100644 index 000000000000..c01457c698bb --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-rapidmigrationassessment + 0.0.1-SNAPSHOT + jar + Google Rapid Migration Assessment API + Rapid Migration Assessment API Rapid Migration Assessment API + + com.google.cloud + google-cloud-rapidmigrationassessment-parent + 0.0.1-SNAPSHOT + + + google-cloud-rapidmigrationassessment + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-rapidmigrationassessment-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-rapidmigrationassessment-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + \ No newline at end of file diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClient.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClient.java new file mode 100644 index 000000000000..94a8b54923a5 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClient.java @@ -0,0 +1,2029 @@ +/* + * 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.rapidmigrationassessment.v1; + +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.rapidmigrationassessment.v1.stub.RapidMigrationAssessmentStub; +import com.google.cloud.rapidmigrationassessment.v1.stub.RapidMigrationAssessmentStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +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: Rapid Migration Assessment service + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+ *     RapidMigrationAssessmentClient.create()) {
+ *   AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]");
+ *   Annotation response = rapidMigrationAssessmentClient.getAnnotation(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the RapidMigrationAssessmentClient 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 + * RapidMigrationAssessmentSettings 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
+ * RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
+ *     RapidMigrationAssessmentSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+ *     RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings);
+ * }
+ * + *

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
+ * RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
+ *     RapidMigrationAssessmentSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+ *     RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings);
+ * }
+ * + *

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
+ * RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
+ *     RapidMigrationAssessmentSettings.newHttpJsonBuilder().build();
+ * RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+ *     RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class RapidMigrationAssessmentClient implements BackgroundResource { + private final RapidMigrationAssessmentSettings settings; + private final RapidMigrationAssessmentStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of RapidMigrationAssessmentClient with default settings. */ + public static final RapidMigrationAssessmentClient create() throws IOException { + return create(RapidMigrationAssessmentSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RapidMigrationAssessmentClient, 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 RapidMigrationAssessmentClient create( + RapidMigrationAssessmentSettings settings) throws IOException { + return new RapidMigrationAssessmentClient(settings); + } + + /** + * Constructs an instance of RapidMigrationAssessmentClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(RapidMigrationAssessmentSettings). + */ + public static final RapidMigrationAssessmentClient create(RapidMigrationAssessmentStub stub) { + return new RapidMigrationAssessmentClient(stub); + } + + /** + * Constructs an instance of RapidMigrationAssessmentClient, 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 RapidMigrationAssessmentClient(RapidMigrationAssessmentSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((RapidMigrationAssessmentStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected RapidMigrationAssessmentClient(RapidMigrationAssessmentStub 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 RapidMigrationAssessmentSettings getSettings() { + return settings; + } + + public RapidMigrationAssessmentStub 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. + /** + * Create a Collector to manage the on-prem appliance which collects information about Customer + * assets. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Collector collector = Collector.newBuilder().build();
+   *   String collectorId = "collectorId1854072456";
+   *   Collector response =
+   *       rapidMigrationAssessmentClient.createCollectorAsync(parent, collector, collectorId).get();
+   * }
+   * }
+ * + * @param parent Required. Name of the parent (project+location). + * @param collector Required. The resource being created. + * @param collectorId Required. Id of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createCollectorAsync( + LocationName parent, Collector collector, String collectorId) { + CreateCollectorRequest request = + CreateCollectorRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCollector(collector) + .setCollectorId(collectorId) + .build(); + return createCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Collector to manage the on-prem appliance which collects information about Customer + * assets. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Collector collector = Collector.newBuilder().build();
+   *   String collectorId = "collectorId1854072456";
+   *   Collector response =
+   *       rapidMigrationAssessmentClient.createCollectorAsync(parent, collector, collectorId).get();
+   * }
+   * }
+ * + * @param parent Required. Name of the parent (project+location). + * @param collector Required. The resource being created. + * @param collectorId Required. Id of the requesting object. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createCollectorAsync( + String parent, Collector collector, String collectorId) { + CreateCollectorRequest request = + CreateCollectorRequest.newBuilder() + .setParent(parent) + .setCollector(collector) + .setCollectorId(collectorId) + .build(); + return createCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Collector to manage the on-prem appliance which collects information about Customer + * assets. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CreateCollectorRequest request =
+   *       CreateCollectorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCollectorId("collectorId1854072456")
+   *           .setCollector(Collector.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.createCollectorAsync(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 createCollectorAsync( + CreateCollectorRequest request) { + return createCollectorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Collector to manage the on-prem appliance which collects information about Customer + * assets. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CreateCollectorRequest request =
+   *       CreateCollectorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCollectorId("collectorId1854072456")
+   *           .setCollector(Collector.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.createCollectorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createCollectorOperationCallable() { + return stub.createCollectorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a Collector to manage the on-prem appliance which collects information about Customer + * assets. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CreateCollectorRequest request =
+   *       CreateCollectorRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCollectorId("collectorId1854072456")
+   *           .setCollector(Collector.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.createCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createCollectorCallable() { + return stub.createCollectorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an Annotation + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Annotation annotation = Annotation.newBuilder().build();
+   *   Annotation response =
+   *       rapidMigrationAssessmentClient.createAnnotationAsync(parent, annotation).get();
+   * }
+   * }
+ * + * @param parent Required. Name of the parent (project+location). + * @param annotation Required. The resource being created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createAnnotationAsync( + LocationName parent, Annotation annotation) { + CreateAnnotationRequest request = + CreateAnnotationRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAnnotation(annotation) + .build(); + return createAnnotationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an Annotation + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Annotation annotation = Annotation.newBuilder().build();
+   *   Annotation response =
+   *       rapidMigrationAssessmentClient.createAnnotationAsync(parent, annotation).get();
+   * }
+   * }
+ * + * @param parent Required. Name of the parent (project+location). + * @param annotation Required. The resource being created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createAnnotationAsync( + String parent, Annotation annotation) { + CreateAnnotationRequest request = + CreateAnnotationRequest.newBuilder().setParent(parent).setAnnotation(annotation).build(); + return createAnnotationAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an Annotation + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CreateAnnotationRequest request =
+   *       CreateAnnotationRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAnnotation(Annotation.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Annotation response = rapidMigrationAssessmentClient.createAnnotationAsync(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 createAnnotationAsync( + CreateAnnotationRequest request) { + return createAnnotationOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an Annotation + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CreateAnnotationRequest request =
+   *       CreateAnnotationRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAnnotation(Annotation.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.createAnnotationOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Annotation response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createAnnotationOperationCallable() { + return stub.createAnnotationOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an Annotation + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CreateAnnotationRequest request =
+   *       CreateAnnotationRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setAnnotation(Annotation.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.createAnnotationCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createAnnotationCallable() { + return stub.createAnnotationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Annotation. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]");
+   *   Annotation response = rapidMigrationAssessmentClient.getAnnotation(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Annotation getAnnotation(AnnotationName name) { + GetAnnotationRequest request = + GetAnnotationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAnnotation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Annotation. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString();
+   *   Annotation response = rapidMigrationAssessmentClient.getAnnotation(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Annotation getAnnotation(String name) { + GetAnnotationRequest request = GetAnnotationRequest.newBuilder().setName(name).build(); + return getAnnotation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Annotation. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   GetAnnotationRequest request =
+   *       GetAnnotationRequest.newBuilder()
+   *           .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString())
+   *           .build();
+   *   Annotation response = rapidMigrationAssessmentClient.getAnnotation(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 Annotation getAnnotation(GetAnnotationRequest request) { + return getAnnotationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Annotation. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   GetAnnotationRequest request =
+   *       GetAnnotationRequest.newBuilder()
+   *           .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.getAnnotationCallable().futureCall(request);
+   *   // Do something.
+   *   Annotation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAnnotationCallable() { + return stub.getAnnotationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Collectors in a given project and 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Collector element : rapidMigrationAssessmentClient.listCollectors(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListCollectorsRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCollectorsPagedResponse listCollectors(LocationName parent) { + ListCollectorsRequest request = + ListCollectorsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCollectors(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Collectors in a given project and 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Collector element : rapidMigrationAssessmentClient.listCollectors(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListCollectorsRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCollectorsPagedResponse listCollectors(String parent) { + ListCollectorsRequest request = ListCollectorsRequest.newBuilder().setParent(parent).build(); + return listCollectors(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Collectors in a given project and 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ListCollectorsRequest request =
+   *       ListCollectorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Collector element :
+   *       rapidMigrationAssessmentClient.listCollectors(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 ListCollectorsPagedResponse listCollectors(ListCollectorsRequest request) { + return listCollectorsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Collectors in a given project and 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ListCollectorsRequest request =
+   *       ListCollectorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.listCollectorsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Collector element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCollectorsPagedCallable() { + return stub.listCollectorsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Collectors in a given project and 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ListCollectorsRequest request =
+   *       ListCollectorsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListCollectorsResponse response =
+   *         rapidMigrationAssessmentClient.listCollectorsCallable().call(request);
+   *     for (Collector element : response.getCollectorsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCollectorsCallable() { + return stub.listCollectorsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]");
+   *   Collector response = rapidMigrationAssessmentClient.getCollector(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Collector getCollector(CollectorName name) { + GetCollectorRequest request = + GetCollectorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCollector(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString();
+   *   Collector response = rapidMigrationAssessmentClient.getCollector(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Collector getCollector(String name) { + GetCollectorRequest request = GetCollectorRequest.newBuilder().setName(name).build(); + return getCollector(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   GetCollectorRequest request =
+   *       GetCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.getCollector(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 Collector getCollector(GetCollectorRequest request) { + return getCollectorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   GetCollectorRequest request =
+   *       GetCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.getCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCollectorCallable() { + return stub.getCollectorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   Collector collector = Collector.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Collector response =
+   *       rapidMigrationAssessmentClient.updateCollectorAsync(collector, updateMask).get();
+   * }
+   * }
+ * + * @param collector Required. The resource being updated. + * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Collector resource by the update. The fields specified in the update_mask are relative to + * the resource, not the full request. A field will be overwritten if it is in the mask. If + * the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateCollectorAsync( + Collector collector, FieldMask updateMask) { + UpdateCollectorRequest request = + UpdateCollectorRequest.newBuilder() + .setCollector(collector) + .setUpdateMask(updateMask) + .build(); + return updateCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   UpdateCollectorRequest request =
+   *       UpdateCollectorRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCollector(Collector.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.updateCollectorAsync(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 updateCollectorAsync( + UpdateCollectorRequest request) { + return updateCollectorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   UpdateCollectorRequest request =
+   *       UpdateCollectorRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCollector(Collector.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.updateCollectorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateCollectorOperationCallable() { + return stub.updateCollectorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   UpdateCollectorRequest request =
+   *       UpdateCollectorRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCollector(Collector.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.updateCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCollectorCallable() { + return stub.updateCollectorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]");
+   *   Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteCollectorAsync( + CollectorName name) { + DeleteCollectorRequest request = + DeleteCollectorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString();
+   *   Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteCollectorAsync(String name) { + DeleteCollectorRequest request = DeleteCollectorRequest.newBuilder().setName(name).build(); + return deleteCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   DeleteCollectorRequest request =
+   *       DeleteCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(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 deleteCollectorAsync( + DeleteCollectorRequest request) { + return deleteCollectorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   DeleteCollectorRequest request =
+   *       DeleteCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.deleteCollectorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteCollectorOperationCallable() { + return stub.deleteCollectorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Collector - changes state of collector to "Deleting". + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   DeleteCollectorRequest request =
+   *       DeleteCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.deleteCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCollectorCallable() { + return stub.deleteCollectorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]");
+   *   Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture resumeCollectorAsync( + CollectorName name) { + ResumeCollectorRequest request = + ResumeCollectorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return resumeCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString();
+   *   Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture resumeCollectorAsync(String name) { + ResumeCollectorRequest request = ResumeCollectorRequest.newBuilder().setName(name).build(); + return resumeCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ResumeCollectorRequest request =
+   *       ResumeCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(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 resumeCollectorAsync( + ResumeCollectorRequest request) { + return resumeCollectorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ResumeCollectorRequest request =
+   *       ResumeCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.resumeCollectorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + resumeCollectorOperationCallable() { + return stub.resumeCollectorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ResumeCollectorRequest request =
+   *       ResumeCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.resumeCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable resumeCollectorCallable() { + return stub.resumeCollectorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Registers the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]");
+   *   Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture registerCollectorAsync( + CollectorName name) { + RegisterCollectorRequest request = + RegisterCollectorRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return registerCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Registers the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString();
+   *   Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture registerCollectorAsync(String name) { + RegisterCollectorRequest request = RegisterCollectorRequest.newBuilder().setName(name).build(); + return registerCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Registers the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   RegisterCollectorRequest request =
+   *       RegisterCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(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 registerCollectorAsync( + RegisterCollectorRequest request) { + return registerCollectorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Registers the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   RegisterCollectorRequest request =
+   *       RegisterCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.registerCollectorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + registerCollectorOperationCallable() { + return stub.registerCollectorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Registers the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   RegisterCollectorRequest request =
+   *       RegisterCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.registerCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable registerCollectorCallable() { + return stub.registerCollectorCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]");
+   *   Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture pauseCollectorAsync( + CollectorName name) { + PauseCollectorRequest request = + PauseCollectorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return pauseCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString();
+   *   Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture pauseCollectorAsync(String name) { + PauseCollectorRequest request = PauseCollectorRequest.newBuilder().setName(name).build(); + return pauseCollectorAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   PauseCollectorRequest request =
+   *       PauseCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(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 pauseCollectorAsync( + PauseCollectorRequest request) { + return pauseCollectorOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   PauseCollectorRequest request =
+   *       PauseCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       rapidMigrationAssessmentClient.pauseCollectorOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Collector response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + pauseCollectorOperationCallable() { + return stub.pauseCollectorOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the given collector. + * + *

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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   PauseCollectorRequest request =
+   *       PauseCollectorRequest.newBuilder()
+   *           .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.pauseCollectorCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable pauseCollectorCallable() { + return stub.pauseCollectorCallable(); + } + + // 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = rapidMigrationAssessmentClient.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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+   *     RapidMigrationAssessmentClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       rapidMigrationAssessmentClient.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 ListCollectorsPagedResponse + extends AbstractPagedListResponse< + ListCollectorsRequest, + ListCollectorsResponse, + Collector, + ListCollectorsPage, + ListCollectorsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCollectorsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCollectorsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCollectorsPagedResponse(ListCollectorsPage page) { + super(page, ListCollectorsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCollectorsPage + extends AbstractPage< + ListCollectorsRequest, ListCollectorsResponse, Collector, ListCollectorsPage> { + + private ListCollectorsPage( + PageContext context, + ListCollectorsResponse response) { + super(context, response); + } + + private static ListCollectorsPage createEmptyPage() { + return new ListCollectorsPage(null, null); + } + + @Override + protected ListCollectorsPage createPage( + PageContext context, + ListCollectorsResponse response) { + return new ListCollectorsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCollectorsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCollectorsRequest, + ListCollectorsResponse, + Collector, + ListCollectorsPage, + ListCollectorsFixedSizeCollection> { + + private ListCollectorsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCollectorsFixedSizeCollection createEmptyCollection() { + return new ListCollectorsFixedSizeCollection(null, 0); + } + + @Override + protected ListCollectorsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCollectorsFixedSizeCollection(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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentSettings.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentSettings.java new file mode 100644 index 000000000000..cbd250e0313a --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentSettings.java @@ -0,0 +1,429 @@ +/* + * 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.rapidmigrationassessment.v1; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +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.rapidmigrationassessment.v1.stub.RapidMigrationAssessmentStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RapidMigrationAssessmentClient}. + * + *

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

    + *
  • The default service address (rapidmigrationassessment.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 getAnnotation 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
+ * RapidMigrationAssessmentSettings.Builder rapidMigrationAssessmentSettingsBuilder =
+ *     RapidMigrationAssessmentSettings.newBuilder();
+ * rapidMigrationAssessmentSettingsBuilder
+ *     .getAnnotationSettings()
+ *     .setRetrySettings(
+ *         rapidMigrationAssessmentSettingsBuilder
+ *             .getAnnotationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings =
+ *     rapidMigrationAssessmentSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RapidMigrationAssessmentSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to createCollector. */ + public UnaryCallSettings createCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).createCollectorSettings(); + } + + /** Returns the object with the settings used for calls to createCollector. */ + public OperationCallSettings + createCollectorOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .createCollectorOperationSettings(); + } + + /** Returns the object with the settings used for calls to createAnnotation. */ + public UnaryCallSettings createAnnotationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).createAnnotationSettings(); + } + + /** Returns the object with the settings used for calls to createAnnotation. */ + public OperationCallSettings + createAnnotationOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .createAnnotationOperationSettings(); + } + + /** Returns the object with the settings used for calls to getAnnotation. */ + public UnaryCallSettings getAnnotationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).getAnnotationSettings(); + } + + /** Returns the object with the settings used for calls to listCollectors. */ + public PagedCallSettings< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + listCollectorsSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).listCollectorsSettings(); + } + + /** Returns the object with the settings used for calls to getCollector. */ + public UnaryCallSettings getCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).getCollectorSettings(); + } + + /** Returns the object with the settings used for calls to updateCollector. */ + public UnaryCallSettings updateCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).updateCollectorSettings(); + } + + /** Returns the object with the settings used for calls to updateCollector. */ + public OperationCallSettings + updateCollectorOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .updateCollectorOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCollector. */ + public UnaryCallSettings deleteCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).deleteCollectorSettings(); + } + + /** Returns the object with the settings used for calls to deleteCollector. */ + public OperationCallSettings + deleteCollectorOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .deleteCollectorOperationSettings(); + } + + /** Returns the object with the settings used for calls to resumeCollector. */ + public UnaryCallSettings resumeCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).resumeCollectorSettings(); + } + + /** Returns the object with the settings used for calls to resumeCollector. */ + public OperationCallSettings + resumeCollectorOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .resumeCollectorOperationSettings(); + } + + /** Returns the object with the settings used for calls to registerCollector. */ + public UnaryCallSettings registerCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).registerCollectorSettings(); + } + + /** Returns the object with the settings used for calls to registerCollector. */ + public OperationCallSettings + registerCollectorOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .registerCollectorOperationSettings(); + } + + /** Returns the object with the settings used for calls to pauseCollector. */ + public UnaryCallSettings pauseCollectorSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).pauseCollectorSettings(); + } + + /** Returns the object with the settings used for calls to pauseCollector. */ + public OperationCallSettings + pauseCollectorOperationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()) + .pauseCollectorOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((RapidMigrationAssessmentStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final RapidMigrationAssessmentSettings create( + RapidMigrationAssessmentStubSettings stub) throws IOException { + return new RapidMigrationAssessmentSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RapidMigrationAssessmentStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RapidMigrationAssessmentStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RapidMigrationAssessmentStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RapidMigrationAssessmentStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RapidMigrationAssessmentStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RapidMigrationAssessmentStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RapidMigrationAssessmentStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RapidMigrationAssessmentStubSettings.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 RapidMigrationAssessmentSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RapidMigrationAssessmentSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RapidMigrationAssessmentStubSettings.newBuilder(clientContext)); + } + + protected Builder(RapidMigrationAssessmentSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RapidMigrationAssessmentStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RapidMigrationAssessmentStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(RapidMigrationAssessmentStubSettings.newHttpJsonBuilder()); + } + + public RapidMigrationAssessmentStubSettings.Builder getStubSettingsBuilder() { + return ((RapidMigrationAssessmentStubSettings.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 createCollector. */ + public UnaryCallSettings.Builder createCollectorSettings() { + return getStubSettingsBuilder().createCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to createCollector. */ + public OperationCallSettings.Builder + createCollectorOperationSettings() { + return getStubSettingsBuilder().createCollectorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createAnnotation. */ + public UnaryCallSettings.Builder + createAnnotationSettings() { + return getStubSettingsBuilder().createAnnotationSettings(); + } + + /** Returns the builder for the settings used for calls to createAnnotation. */ + public OperationCallSettings.Builder + createAnnotationOperationSettings() { + return getStubSettingsBuilder().createAnnotationOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getAnnotation. */ + public UnaryCallSettings.Builder getAnnotationSettings() { + return getStubSettingsBuilder().getAnnotationSettings(); + } + + /** Returns the builder for the settings used for calls to listCollectors. */ + public PagedCallSettings.Builder< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + listCollectorsSettings() { + return getStubSettingsBuilder().listCollectorsSettings(); + } + + /** Returns the builder for the settings used for calls to getCollector. */ + public UnaryCallSettings.Builder getCollectorSettings() { + return getStubSettingsBuilder().getCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to updateCollector. */ + public UnaryCallSettings.Builder updateCollectorSettings() { + return getStubSettingsBuilder().updateCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to updateCollector. */ + public OperationCallSettings.Builder + updateCollectorOperationSettings() { + return getStubSettingsBuilder().updateCollectorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCollector. */ + public UnaryCallSettings.Builder deleteCollectorSettings() { + return getStubSettingsBuilder().deleteCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCollector. */ + public OperationCallSettings.Builder + deleteCollectorOperationSettings() { + return getStubSettingsBuilder().deleteCollectorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to resumeCollector. */ + public UnaryCallSettings.Builder resumeCollectorSettings() { + return getStubSettingsBuilder().resumeCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to resumeCollector. */ + public OperationCallSettings.Builder + resumeCollectorOperationSettings() { + return getStubSettingsBuilder().resumeCollectorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to registerCollector. */ + public UnaryCallSettings.Builder + registerCollectorSettings() { + return getStubSettingsBuilder().registerCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to registerCollector. */ + public OperationCallSettings.Builder + registerCollectorOperationSettings() { + return getStubSettingsBuilder().registerCollectorOperationSettings(); + } + + /** Returns the builder for the settings used for calls to pauseCollector. */ + public UnaryCallSettings.Builder pauseCollectorSettings() { + return getStubSettingsBuilder().pauseCollectorSettings(); + } + + /** Returns the builder for the settings used for calls to pauseCollector. */ + public OperationCallSettings.Builder + pauseCollectorOperationSettings() { + return getStubSettingsBuilder().pauseCollectorOperationSettings(); + } + + /** 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 RapidMigrationAssessmentSettings build() throws IOException { + return new RapidMigrationAssessmentSettings(this); + } + } +} diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/gapic_metadata.json b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/gapic_metadata.json new file mode 100644 index 000000000000..9789bc2645ea --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/gapic_metadata.json @@ -0,0 +1,54 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.rapidmigrationassessment.v1", + "libraryPackage": "com.google.cloud.rapidmigrationassessment.v1", + "services": { + "RapidMigrationAssessment": { + "clients": { + "grpc": { + "libraryClient": "RapidMigrationAssessmentClient", + "rpcs": { + "CreateAnnotation": { + "methods": ["createAnnotationAsync", "createAnnotationAsync", "createAnnotationAsync", "createAnnotationOperationCallable", "createAnnotationCallable"] + }, + "CreateCollector": { + "methods": ["createCollectorAsync", "createCollectorAsync", "createCollectorAsync", "createCollectorOperationCallable", "createCollectorCallable"] + }, + "DeleteCollector": { + "methods": ["deleteCollectorAsync", "deleteCollectorAsync", "deleteCollectorAsync", "deleteCollectorOperationCallable", "deleteCollectorCallable"] + }, + "GetAnnotation": { + "methods": ["getAnnotation", "getAnnotation", "getAnnotation", "getAnnotationCallable"] + }, + "GetCollector": { + "methods": ["getCollector", "getCollector", "getCollector", "getCollectorCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListCollectors": { + "methods": ["listCollectors", "listCollectors", "listCollectors", "listCollectorsPagedCallable", "listCollectorsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "PauseCollector": { + "methods": ["pauseCollectorAsync", "pauseCollectorAsync", "pauseCollectorAsync", "pauseCollectorOperationCallable", "pauseCollectorCallable"] + }, + "RegisterCollector": { + "methods": ["registerCollectorAsync", "registerCollectorAsync", "registerCollectorAsync", "registerCollectorOperationCallable", "registerCollectorCallable"] + }, + "ResumeCollector": { + "methods": ["resumeCollectorAsync", "resumeCollectorAsync", "resumeCollectorAsync", "resumeCollectorOperationCallable", "resumeCollectorCallable"] + }, + "UpdateCollector": { + "methods": ["updateCollectorAsync", "updateCollectorAsync", "updateCollectorOperationCallable", "updateCollectorCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/package-info.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/package-info.java new file mode 100644 index 000000000000..680159bbc16d --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/package-info.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. + */ + +/** + * A client to Rapid Migration Assessment API + * + *

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

======================= RapidMigrationAssessmentClient ======================= + * + *

Service Description: Rapid Migration Assessment service + * + *

Sample for RapidMigrationAssessmentClient: + * + *

{@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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient =
+ *     RapidMigrationAssessmentClient.create()) {
+ *   AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]");
+ *   Annotation response = rapidMigrationAssessmentClient.getAnnotation(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.rapidmigrationassessment.v1; + +import javax.annotation.Generated; diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentCallableFactory.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentCallableFactory.java new file mode 100644 index 000000000000..2db847293fc5 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentCallableFactory.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.rapidmigrationassessment.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the RapidMigrationAssessment service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcRapidMigrationAssessmentCallableFactory 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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentStub.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentStub.java new file mode 100644 index 000000000000..70de18f81c15 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/GrpcRapidMigrationAssessmentStub.java @@ -0,0 +1,635 @@ +/* + * 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.rapidmigrationassessment.v1.stub; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +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.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the RapidMigrationAssessment service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcRapidMigrationAssessmentStub extends RapidMigrationAssessmentStub { + private static final MethodDescriptor + createCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateCollector") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateCollectorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAnnotationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateAnnotation") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAnnotationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getAnnotationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetAnnotation") + .setRequestMarshaller( + ProtoUtils.marshaller(GetAnnotationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Annotation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCollectorsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/ListCollectors") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCollectorsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCollectorsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetCollector") + .setRequestMarshaller(ProtoUtils.marshaller(GetCollectorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Collector.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/UpdateCollector") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCollectorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/DeleteCollector") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCollectorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + resumeCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/ResumeCollector") + .setRequestMarshaller( + ProtoUtils.marshaller(ResumeCollectorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + registerCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/RegisterCollector") + .setRequestMarshaller( + ProtoUtils.marshaller(RegisterCollectorRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + pauseCollectorMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/PauseCollector") + .setRequestMarshaller( + ProtoUtils.marshaller(PauseCollectorRequest.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 createCollectorCallable; + private final OperationCallable + createCollectorOperationCallable; + private final UnaryCallable createAnnotationCallable; + private final OperationCallable + createAnnotationOperationCallable; + private final UnaryCallable getAnnotationCallable; + private final UnaryCallable listCollectorsCallable; + private final UnaryCallable + listCollectorsPagedCallable; + private final UnaryCallable getCollectorCallable; + private final UnaryCallable updateCollectorCallable; + private final OperationCallable + updateCollectorOperationCallable; + private final UnaryCallable deleteCollectorCallable; + private final OperationCallable + deleteCollectorOperationCallable; + private final UnaryCallable resumeCollectorCallable; + private final OperationCallable + resumeCollectorOperationCallable; + private final UnaryCallable registerCollectorCallable; + private final OperationCallable + registerCollectorOperationCallable; + private final UnaryCallable pauseCollectorCallable; + private final OperationCallable + pauseCollectorOperationCallable; + 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 GrpcRapidMigrationAssessmentStub create( + RapidMigrationAssessmentStubSettings settings) throws IOException { + return new GrpcRapidMigrationAssessmentStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRapidMigrationAssessmentStub create(ClientContext clientContext) + throws IOException { + return new GrpcRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRapidMigrationAssessmentStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRapidMigrationAssessmentStub, 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 GrpcRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRapidMigrationAssessmentCallableFactory()); + } + + /** + * Constructs an instance of GrpcRapidMigrationAssessmentStub, 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 GrpcRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createCollectorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings createAnnotationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAnnotationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getAnnotationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAnnotationMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listCollectorsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCollectorsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCollectorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings updateCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCollectorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("collector.name", String.valueOf(request.getCollector().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCollectorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings resumeCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resumeCollectorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings registerCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(registerCollectorMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings pauseCollectorTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pauseCollectorMethodDescriptor) + .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.createCollectorCallable = + callableFactory.createUnaryCallable( + createCollectorTransportSettings, settings.createCollectorSettings(), clientContext); + this.createCollectorOperationCallable = + callableFactory.createOperationCallable( + createCollectorTransportSettings, + settings.createCollectorOperationSettings(), + clientContext, + operationsStub); + this.createAnnotationCallable = + callableFactory.createUnaryCallable( + createAnnotationTransportSettings, settings.createAnnotationSettings(), clientContext); + this.createAnnotationOperationCallable = + callableFactory.createOperationCallable( + createAnnotationTransportSettings, + settings.createAnnotationOperationSettings(), + clientContext, + operationsStub); + this.getAnnotationCallable = + callableFactory.createUnaryCallable( + getAnnotationTransportSettings, settings.getAnnotationSettings(), clientContext); + this.listCollectorsCallable = + callableFactory.createUnaryCallable( + listCollectorsTransportSettings, settings.listCollectorsSettings(), clientContext); + this.listCollectorsPagedCallable = + callableFactory.createPagedCallable( + listCollectorsTransportSettings, settings.listCollectorsSettings(), clientContext); + this.getCollectorCallable = + callableFactory.createUnaryCallable( + getCollectorTransportSettings, settings.getCollectorSettings(), clientContext); + this.updateCollectorCallable = + callableFactory.createUnaryCallable( + updateCollectorTransportSettings, settings.updateCollectorSettings(), clientContext); + this.updateCollectorOperationCallable = + callableFactory.createOperationCallable( + updateCollectorTransportSettings, + settings.updateCollectorOperationSettings(), + clientContext, + operationsStub); + this.deleteCollectorCallable = + callableFactory.createUnaryCallable( + deleteCollectorTransportSettings, settings.deleteCollectorSettings(), clientContext); + this.deleteCollectorOperationCallable = + callableFactory.createOperationCallable( + deleteCollectorTransportSettings, + settings.deleteCollectorOperationSettings(), + clientContext, + operationsStub); + this.resumeCollectorCallable = + callableFactory.createUnaryCallable( + resumeCollectorTransportSettings, settings.resumeCollectorSettings(), clientContext); + this.resumeCollectorOperationCallable = + callableFactory.createOperationCallable( + resumeCollectorTransportSettings, + settings.resumeCollectorOperationSettings(), + clientContext, + operationsStub); + this.registerCollectorCallable = + callableFactory.createUnaryCallable( + registerCollectorTransportSettings, + settings.registerCollectorSettings(), + clientContext); + this.registerCollectorOperationCallable = + callableFactory.createOperationCallable( + registerCollectorTransportSettings, + settings.registerCollectorOperationSettings(), + clientContext, + operationsStub); + this.pauseCollectorCallable = + callableFactory.createUnaryCallable( + pauseCollectorTransportSettings, settings.pauseCollectorSettings(), clientContext); + this.pauseCollectorOperationCallable = + callableFactory.createOperationCallable( + pauseCollectorTransportSettings, + settings.pauseCollectorOperationSettings(), + 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()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createCollectorCallable() { + return createCollectorCallable; + } + + @Override + public OperationCallable + createCollectorOperationCallable() { + return createCollectorOperationCallable; + } + + @Override + public UnaryCallable createAnnotationCallable() { + return createAnnotationCallable; + } + + @Override + public OperationCallable + createAnnotationOperationCallable() { + return createAnnotationOperationCallable; + } + + @Override + public UnaryCallable getAnnotationCallable() { + return getAnnotationCallable; + } + + @Override + public UnaryCallable listCollectorsCallable() { + return listCollectorsCallable; + } + + @Override + public UnaryCallable + listCollectorsPagedCallable() { + return listCollectorsPagedCallable; + } + + @Override + public UnaryCallable getCollectorCallable() { + return getCollectorCallable; + } + + @Override + public UnaryCallable updateCollectorCallable() { + return updateCollectorCallable; + } + + @Override + public OperationCallable + updateCollectorOperationCallable() { + return updateCollectorOperationCallable; + } + + @Override + public UnaryCallable deleteCollectorCallable() { + return deleteCollectorCallable; + } + + @Override + public OperationCallable + deleteCollectorOperationCallable() { + return deleteCollectorOperationCallable; + } + + @Override + public UnaryCallable resumeCollectorCallable() { + return resumeCollectorCallable; + } + + @Override + public OperationCallable + resumeCollectorOperationCallable() { + return resumeCollectorOperationCallable; + } + + @Override + public UnaryCallable registerCollectorCallable() { + return registerCollectorCallable; + } + + @Override + public OperationCallable + registerCollectorOperationCallable() { + return registerCollectorOperationCallable; + } + + @Override + public UnaryCallable pauseCollectorCallable() { + return pauseCollectorCallable; + } + + @Override + public OperationCallable + pauseCollectorOperationCallable() { + return pauseCollectorOperationCallable; + } + + @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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentCallableFactory.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentCallableFactory.java new file mode 100644 index 000000000000..67ce888f458d --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentCallableFactory.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.rapidmigrationassessment.v1.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 RapidMigrationAssessment service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRapidMigrationAssessmentCallableFactory + 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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentStub.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentStub.java new file mode 100644 index 000000000000..18db4eb5ae92 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/HttpJsonRapidMigrationAssessmentStub.java @@ -0,0 +1,981 @@ +/* + * 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.rapidmigrationassessment.v1.stub; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +import com.google.api.HttpRule; +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.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +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 RapidMigrationAssessment service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonRapidMigrationAssessmentStub extends RapidMigrationAssessmentStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Collector.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Annotation.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateCollector") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/collectors", + 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, "collectorId", request.getCollectorId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("collector", request.getCollector(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateCollectorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + createAnnotationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/CreateAnnotation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/annotations", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("annotation", request.getAnnotation(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateAnnotationRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getAnnotationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetAnnotation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/annotations/*}", + 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(Annotation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listCollectorsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/ListCollectors") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/collectors", + 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(ListCollectorsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/GetCollector") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/collectors/*}", + 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(Collector.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/UpdateCollector") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{collector.name=projects/*/locations/*/collectors/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "collector.name", request.getCollector().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("collector", request.getCollector(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateCollectorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/DeleteCollector") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/collectors/*}", + 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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteCollectorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + resumeCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/ResumeCollector") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/collectors/*}:resume", + 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( + (ResumeCollectorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + registerCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/RegisterCollector") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/collectors/*}:register", + 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( + (RegisterCollectorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + pauseCollectorMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment/PauseCollector") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/collectors/*}:pause", + 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( + (PauseCollectorRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + 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(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( + "/v1/{name=projects/*/locations/*}", + 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(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createCollectorCallable; + private final OperationCallable + createCollectorOperationCallable; + private final UnaryCallable createAnnotationCallable; + private final OperationCallable + createAnnotationOperationCallable; + private final UnaryCallable getAnnotationCallable; + private final UnaryCallable listCollectorsCallable; + private final UnaryCallable + listCollectorsPagedCallable; + private final UnaryCallable getCollectorCallable; + private final UnaryCallable updateCollectorCallable; + private final OperationCallable + updateCollectorOperationCallable; + private final UnaryCallable deleteCollectorCallable; + private final OperationCallable + deleteCollectorOperationCallable; + private final UnaryCallable resumeCollectorCallable; + private final OperationCallable + resumeCollectorOperationCallable; + private final UnaryCallable registerCollectorCallable; + private final OperationCallable + registerCollectorOperationCallable; + private final UnaryCallable pauseCollectorCallable; + private final OperationCallable + pauseCollectorOperationCallable; + 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 HttpJsonRapidMigrationAssessmentStub create( + RapidMigrationAssessmentStubSettings settings) throws IOException { + return new HttpJsonRapidMigrationAssessmentStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRapidMigrationAssessmentStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRapidMigrationAssessmentStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonRapidMigrationAssessmentStub, 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 HttpJsonRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonRapidMigrationAssessmentCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRapidMigrationAssessmentStub, 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 HttpJsonRapidMigrationAssessmentStub( + RapidMigrationAssessmentStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings createCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createAnnotationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createAnnotationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getAnnotationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAnnotationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listCollectorsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listCollectorsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings resumeCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resumeCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings registerCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(registerCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pauseCollectorTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pauseCollectorMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createCollectorCallable = + callableFactory.createUnaryCallable( + createCollectorTransportSettings, settings.createCollectorSettings(), clientContext); + this.createCollectorOperationCallable = + callableFactory.createOperationCallable( + createCollectorTransportSettings, + settings.createCollectorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.createAnnotationCallable = + callableFactory.createUnaryCallable( + createAnnotationTransportSettings, settings.createAnnotationSettings(), clientContext); + this.createAnnotationOperationCallable = + callableFactory.createOperationCallable( + createAnnotationTransportSettings, + settings.createAnnotationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getAnnotationCallable = + callableFactory.createUnaryCallable( + getAnnotationTransportSettings, settings.getAnnotationSettings(), clientContext); + this.listCollectorsCallable = + callableFactory.createUnaryCallable( + listCollectorsTransportSettings, settings.listCollectorsSettings(), clientContext); + this.listCollectorsPagedCallable = + callableFactory.createPagedCallable( + listCollectorsTransportSettings, settings.listCollectorsSettings(), clientContext); + this.getCollectorCallable = + callableFactory.createUnaryCallable( + getCollectorTransportSettings, settings.getCollectorSettings(), clientContext); + this.updateCollectorCallable = + callableFactory.createUnaryCallable( + updateCollectorTransportSettings, settings.updateCollectorSettings(), clientContext); + this.updateCollectorOperationCallable = + callableFactory.createOperationCallable( + updateCollectorTransportSettings, + settings.updateCollectorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteCollectorCallable = + callableFactory.createUnaryCallable( + deleteCollectorTransportSettings, settings.deleteCollectorSettings(), clientContext); + this.deleteCollectorOperationCallable = + callableFactory.createOperationCallable( + deleteCollectorTransportSettings, + settings.deleteCollectorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.resumeCollectorCallable = + callableFactory.createUnaryCallable( + resumeCollectorTransportSettings, settings.resumeCollectorSettings(), clientContext); + this.resumeCollectorOperationCallable = + callableFactory.createOperationCallable( + resumeCollectorTransportSettings, + settings.resumeCollectorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.registerCollectorCallable = + callableFactory.createUnaryCallable( + registerCollectorTransportSettings, + settings.registerCollectorSettings(), + clientContext); + this.registerCollectorOperationCallable = + callableFactory.createOperationCallable( + registerCollectorTransportSettings, + settings.registerCollectorOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.pauseCollectorCallable = + callableFactory.createUnaryCallable( + pauseCollectorTransportSettings, settings.pauseCollectorSettings(), clientContext); + this.pauseCollectorOperationCallable = + callableFactory.createOperationCallable( + pauseCollectorTransportSettings, + settings.pauseCollectorOperationSettings(), + clientContext, + httpJsonOperationsStub); + 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(createCollectorMethodDescriptor); + methodDescriptors.add(createAnnotationMethodDescriptor); + methodDescriptors.add(getAnnotationMethodDescriptor); + methodDescriptors.add(listCollectorsMethodDescriptor); + methodDescriptors.add(getCollectorMethodDescriptor); + methodDescriptors.add(updateCollectorMethodDescriptor); + methodDescriptors.add(deleteCollectorMethodDescriptor); + methodDescriptors.add(resumeCollectorMethodDescriptor); + methodDescriptors.add(registerCollectorMethodDescriptor); + methodDescriptors.add(pauseCollectorMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createCollectorCallable() { + return createCollectorCallable; + } + + @Override + public OperationCallable + createCollectorOperationCallable() { + return createCollectorOperationCallable; + } + + @Override + public UnaryCallable createAnnotationCallable() { + return createAnnotationCallable; + } + + @Override + public OperationCallable + createAnnotationOperationCallable() { + return createAnnotationOperationCallable; + } + + @Override + public UnaryCallable getAnnotationCallable() { + return getAnnotationCallable; + } + + @Override + public UnaryCallable listCollectorsCallable() { + return listCollectorsCallable; + } + + @Override + public UnaryCallable + listCollectorsPagedCallable() { + return listCollectorsPagedCallable; + } + + @Override + public UnaryCallable getCollectorCallable() { + return getCollectorCallable; + } + + @Override + public UnaryCallable updateCollectorCallable() { + return updateCollectorCallable; + } + + @Override + public OperationCallable + updateCollectorOperationCallable() { + return updateCollectorOperationCallable; + } + + @Override + public UnaryCallable deleteCollectorCallable() { + return deleteCollectorCallable; + } + + @Override + public OperationCallable + deleteCollectorOperationCallable() { + return deleteCollectorOperationCallable; + } + + @Override + public UnaryCallable resumeCollectorCallable() { + return resumeCollectorCallable; + } + + @Override + public OperationCallable + resumeCollectorOperationCallable() { + return resumeCollectorOperationCallable; + } + + @Override + public UnaryCallable registerCollectorCallable() { + return registerCollectorCallable; + } + + @Override + public OperationCallable + registerCollectorOperationCallable() { + return registerCollectorOperationCallable; + } + + @Override + public UnaryCallable pauseCollectorCallable() { + return pauseCollectorCallable; + } + + @Override + public OperationCallable + pauseCollectorOperationCallable() { + return pauseCollectorOperationCallable; + } + + @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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStub.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStub.java new file mode 100644 index 000000000000..bb8a0334a093 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStub.java @@ -0,0 +1,160 @@ +/* + * 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.rapidmigrationassessment.v1.stub; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +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.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RapidMigrationAssessment service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class RapidMigrationAssessmentStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable + createCollectorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createCollectorOperationCallable()"); + } + + public UnaryCallable createCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: createCollectorCallable()"); + } + + public OperationCallable + createAnnotationOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createAnnotationOperationCallable()"); + } + + public UnaryCallable createAnnotationCallable() { + throw new UnsupportedOperationException("Not implemented: createAnnotationCallable()"); + } + + public UnaryCallable getAnnotationCallable() { + throw new UnsupportedOperationException("Not implemented: getAnnotationCallable()"); + } + + public UnaryCallable + listCollectorsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCollectorsPagedCallable()"); + } + + public UnaryCallable listCollectorsCallable() { + throw new UnsupportedOperationException("Not implemented: listCollectorsCallable()"); + } + + public UnaryCallable getCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: getCollectorCallable()"); + } + + public OperationCallable + updateCollectorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateCollectorOperationCallable()"); + } + + public UnaryCallable updateCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: updateCollectorCallable()"); + } + + public OperationCallable + deleteCollectorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCollectorOperationCallable()"); + } + + public UnaryCallable deleteCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCollectorCallable()"); + } + + public OperationCallable + resumeCollectorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: resumeCollectorOperationCallable()"); + } + + public UnaryCallable resumeCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: resumeCollectorCallable()"); + } + + public OperationCallable + registerCollectorOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: registerCollectorOperationCallable()"); + } + + public UnaryCallable registerCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: registerCollectorCallable()"); + } + + public OperationCallable + pauseCollectorOperationCallable() { + throw new UnsupportedOperationException("Not implemented: pauseCollectorOperationCallable()"); + } + + public UnaryCallable pauseCollectorCallable() { + throw new UnsupportedOperationException("Not implemented: pauseCollectorCallable()"); + } + + 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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStubSettings.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStubSettings.java new file mode 100644 index 000000000000..df90f72ae693 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/main/java/com/google/cloud/rapidmigrationassessment/v1/stub/RapidMigrationAssessmentStubSettings.java @@ -0,0 +1,1072 @@ +/* + * 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.rapidmigrationassessment.v1.stub; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +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.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RapidMigrationAssessmentStub}. + * + *

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

    + *
  • The default service address (rapidmigrationassessment.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 getAnnotation 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
+ * RapidMigrationAssessmentStubSettings.Builder rapidMigrationAssessmentSettingsBuilder =
+ *     RapidMigrationAssessmentStubSettings.newBuilder();
+ * rapidMigrationAssessmentSettingsBuilder
+ *     .getAnnotationSettings()
+ *     .setRetrySettings(
+ *         rapidMigrationAssessmentSettingsBuilder
+ *             .getAnnotationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RapidMigrationAssessmentStubSettings rapidMigrationAssessmentSettings =
+ *     rapidMigrationAssessmentSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class RapidMigrationAssessmentStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createCollectorSettings; + private final OperationCallSettings + createCollectorOperationSettings; + private final UnaryCallSettings createAnnotationSettings; + private final OperationCallSettings + createAnnotationOperationSettings; + private final UnaryCallSettings getAnnotationSettings; + private final PagedCallSettings< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + listCollectorsSettings; + private final UnaryCallSettings getCollectorSettings; + private final UnaryCallSettings updateCollectorSettings; + private final OperationCallSettings + updateCollectorOperationSettings; + private final UnaryCallSettings deleteCollectorSettings; + private final OperationCallSettings + deleteCollectorOperationSettings; + private final UnaryCallSettings resumeCollectorSettings; + private final OperationCallSettings + resumeCollectorOperationSettings; + private final UnaryCallSettings registerCollectorSettings; + private final OperationCallSettings + registerCollectorOperationSettings; + private final UnaryCallSettings pauseCollectorSettings; + private final OperationCallSettings + pauseCollectorOperationSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_COLLECTORS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCollectorsRequest injectToken(ListCollectorsRequest payload, String token) { + return ListCollectorsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCollectorsRequest injectPageSize( + ListCollectorsRequest payload, int pageSize) { + return ListCollectorsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCollectorsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCollectorsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCollectorsResponse payload) { + return payload.getCollectorsList() == null + ? ImmutableList.of() + : payload.getCollectorsList(); + } + }; + + 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< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + LIST_COLLECTORS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCollectorsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_COLLECTORS_PAGE_STR_DESC, request, context); + return ListCollectorsPagedResponse.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 createCollector. */ + public UnaryCallSettings createCollectorSettings() { + return createCollectorSettings; + } + + /** Returns the object with the settings used for calls to createCollector. */ + public OperationCallSettings + createCollectorOperationSettings() { + return createCollectorOperationSettings; + } + + /** Returns the object with the settings used for calls to createAnnotation. */ + public UnaryCallSettings createAnnotationSettings() { + return createAnnotationSettings; + } + + /** Returns the object with the settings used for calls to createAnnotation. */ + public OperationCallSettings + createAnnotationOperationSettings() { + return createAnnotationOperationSettings; + } + + /** Returns the object with the settings used for calls to getAnnotation. */ + public UnaryCallSettings getAnnotationSettings() { + return getAnnotationSettings; + } + + /** Returns the object with the settings used for calls to listCollectors. */ + public PagedCallSettings< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + listCollectorsSettings() { + return listCollectorsSettings; + } + + /** Returns the object with the settings used for calls to getCollector. */ + public UnaryCallSettings getCollectorSettings() { + return getCollectorSettings; + } + + /** Returns the object with the settings used for calls to updateCollector. */ + public UnaryCallSettings updateCollectorSettings() { + return updateCollectorSettings; + } + + /** Returns the object with the settings used for calls to updateCollector. */ + public OperationCallSettings + updateCollectorOperationSettings() { + return updateCollectorOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteCollector. */ + public UnaryCallSettings deleteCollectorSettings() { + return deleteCollectorSettings; + } + + /** Returns the object with the settings used for calls to deleteCollector. */ + public OperationCallSettings + deleteCollectorOperationSettings() { + return deleteCollectorOperationSettings; + } + + /** Returns the object with the settings used for calls to resumeCollector. */ + public UnaryCallSettings resumeCollectorSettings() { + return resumeCollectorSettings; + } + + /** Returns the object with the settings used for calls to resumeCollector. */ + public OperationCallSettings + resumeCollectorOperationSettings() { + return resumeCollectorOperationSettings; + } + + /** Returns the object with the settings used for calls to registerCollector. */ + public UnaryCallSettings registerCollectorSettings() { + return registerCollectorSettings; + } + + /** Returns the object with the settings used for calls to registerCollector. */ + public OperationCallSettings + registerCollectorOperationSettings() { + return registerCollectorOperationSettings; + } + + /** Returns the object with the settings used for calls to pauseCollector. */ + public UnaryCallSettings pauseCollectorSettings() { + return pauseCollectorSettings; + } + + /** Returns the object with the settings used for calls to pauseCollector. */ + public OperationCallSettings + pauseCollectorOperationSettings() { + return pauseCollectorOperationSettings; + } + + /** 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 RapidMigrationAssessmentStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRapidMigrationAssessmentStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRapidMigrationAssessmentStub.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 "rapidmigrationassessment.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "rapidmigrationassessment.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(RapidMigrationAssessmentStubSettings.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(RapidMigrationAssessmentStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RapidMigrationAssessmentStubSettings.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 RapidMigrationAssessmentStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createCollectorSettings = settingsBuilder.createCollectorSettings().build(); + createCollectorOperationSettings = settingsBuilder.createCollectorOperationSettings().build(); + createAnnotationSettings = settingsBuilder.createAnnotationSettings().build(); + createAnnotationOperationSettings = settingsBuilder.createAnnotationOperationSettings().build(); + getAnnotationSettings = settingsBuilder.getAnnotationSettings().build(); + listCollectorsSettings = settingsBuilder.listCollectorsSettings().build(); + getCollectorSettings = settingsBuilder.getCollectorSettings().build(); + updateCollectorSettings = settingsBuilder.updateCollectorSettings().build(); + updateCollectorOperationSettings = settingsBuilder.updateCollectorOperationSettings().build(); + deleteCollectorSettings = settingsBuilder.deleteCollectorSettings().build(); + deleteCollectorOperationSettings = settingsBuilder.deleteCollectorOperationSettings().build(); + resumeCollectorSettings = settingsBuilder.resumeCollectorSettings().build(); + resumeCollectorOperationSettings = settingsBuilder.resumeCollectorOperationSettings().build(); + registerCollectorSettings = settingsBuilder.registerCollectorSettings().build(); + registerCollectorOperationSettings = + settingsBuilder.registerCollectorOperationSettings().build(); + pauseCollectorSettings = settingsBuilder.pauseCollectorSettings().build(); + pauseCollectorOperationSettings = settingsBuilder.pauseCollectorOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for RapidMigrationAssessmentStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createCollectorSettings; + private final OperationCallSettings.Builder< + CreateCollectorRequest, Collector, OperationMetadata> + createCollectorOperationSettings; + private final UnaryCallSettings.Builder + createAnnotationSettings; + private final OperationCallSettings.Builder< + CreateAnnotationRequest, Annotation, OperationMetadata> + createAnnotationOperationSettings; + private final UnaryCallSettings.Builder getAnnotationSettings; + private final PagedCallSettings.Builder< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + listCollectorsSettings; + private final UnaryCallSettings.Builder getCollectorSettings; + private final UnaryCallSettings.Builder + updateCollectorSettings; + private final OperationCallSettings.Builder< + UpdateCollectorRequest, Collector, OperationMetadata> + updateCollectorOperationSettings; + private final UnaryCallSettings.Builder + deleteCollectorSettings; + private final OperationCallSettings.Builder< + DeleteCollectorRequest, Collector, OperationMetadata> + deleteCollectorOperationSettings; + private final UnaryCallSettings.Builder + resumeCollectorSettings; + private final OperationCallSettings.Builder< + ResumeCollectorRequest, Collector, OperationMetadata> + resumeCollectorOperationSettings; + private final UnaryCallSettings.Builder + registerCollectorSettings; + private final OperationCallSettings.Builder< + RegisterCollectorRequest, Collector, OperationMetadata> + registerCollectorOperationSettings; + private final UnaryCallSettings.Builder + pauseCollectorSettings; + private final OperationCallSettings.Builder + pauseCollectorOperationSettings; + 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_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_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_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createCollectorOperationSettings = OperationCallSettings.newBuilder(); + createAnnotationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createAnnotationOperationSettings = OperationCallSettings.newBuilder(); + getAnnotationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCollectorsSettings = PagedCallSettings.newBuilder(LIST_COLLECTORS_PAGE_STR_FACT); + getCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateCollectorOperationSettings = OperationCallSettings.newBuilder(); + deleteCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteCollectorOperationSettings = OperationCallSettings.newBuilder(); + resumeCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resumeCollectorOperationSettings = OperationCallSettings.newBuilder(); + registerCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + registerCollectorOperationSettings = OperationCallSettings.newBuilder(); + pauseCollectorSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + pauseCollectorOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createCollectorSettings, + createAnnotationSettings, + getAnnotationSettings, + listCollectorsSettings, + getCollectorSettings, + updateCollectorSettings, + deleteCollectorSettings, + resumeCollectorSettings, + registerCollectorSettings, + pauseCollectorSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(RapidMigrationAssessmentStubSettings settings) { + super(settings); + + createCollectorSettings = settings.createCollectorSettings.toBuilder(); + createCollectorOperationSettings = settings.createCollectorOperationSettings.toBuilder(); + createAnnotationSettings = settings.createAnnotationSettings.toBuilder(); + createAnnotationOperationSettings = settings.createAnnotationOperationSettings.toBuilder(); + getAnnotationSettings = settings.getAnnotationSettings.toBuilder(); + listCollectorsSettings = settings.listCollectorsSettings.toBuilder(); + getCollectorSettings = settings.getCollectorSettings.toBuilder(); + updateCollectorSettings = settings.updateCollectorSettings.toBuilder(); + updateCollectorOperationSettings = settings.updateCollectorOperationSettings.toBuilder(); + deleteCollectorSettings = settings.deleteCollectorSettings.toBuilder(); + deleteCollectorOperationSettings = settings.deleteCollectorOperationSettings.toBuilder(); + resumeCollectorSettings = settings.resumeCollectorSettings.toBuilder(); + resumeCollectorOperationSettings = settings.resumeCollectorOperationSettings.toBuilder(); + registerCollectorSettings = settings.registerCollectorSettings.toBuilder(); + registerCollectorOperationSettings = settings.registerCollectorOperationSettings.toBuilder(); + pauseCollectorSettings = settings.pauseCollectorSettings.toBuilder(); + pauseCollectorOperationSettings = settings.pauseCollectorOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createCollectorSettings, + createAnnotationSettings, + getAnnotationSettings, + listCollectorsSettings, + getCollectorSettings, + updateCollectorSettings, + deleteCollectorSettings, + resumeCollectorSettings, + registerCollectorSettings, + pauseCollectorSettings, + 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 + .createCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .createAnnotationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getAnnotationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listCollectorsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .resumeCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .registerCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .pauseCollectorSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createCollectorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Collector.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 + .createAnnotationOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Annotation.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 + .updateCollectorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Collector.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 + .deleteCollectorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Collector.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 + .resumeCollectorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Collector.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 + .registerCollectorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Collector.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 + .pauseCollectorOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Collector.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 createCollector. */ + public UnaryCallSettings.Builder createCollectorSettings() { + return createCollectorSettings; + } + + /** Returns the builder for the settings used for calls to createCollector. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createCollectorOperationSettings() { + return createCollectorOperationSettings; + } + + /** Returns the builder for the settings used for calls to createAnnotation. */ + public UnaryCallSettings.Builder + createAnnotationSettings() { + return createAnnotationSettings; + } + + /** Returns the builder for the settings used for calls to createAnnotation. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createAnnotationOperationSettings() { + return createAnnotationOperationSettings; + } + + /** Returns the builder for the settings used for calls to getAnnotation. */ + public UnaryCallSettings.Builder getAnnotationSettings() { + return getAnnotationSettings; + } + + /** Returns the builder for the settings used for calls to listCollectors. */ + public PagedCallSettings.Builder< + ListCollectorsRequest, ListCollectorsResponse, ListCollectorsPagedResponse> + listCollectorsSettings() { + return listCollectorsSettings; + } + + /** Returns the builder for the settings used for calls to getCollector. */ + public UnaryCallSettings.Builder getCollectorSettings() { + return getCollectorSettings; + } + + /** Returns the builder for the settings used for calls to updateCollector. */ + public UnaryCallSettings.Builder updateCollectorSettings() { + return updateCollectorSettings; + } + + /** Returns the builder for the settings used for calls to updateCollector. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateCollectorOperationSettings() { + return updateCollectorOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteCollector. */ + public UnaryCallSettings.Builder deleteCollectorSettings() { + return deleteCollectorSettings; + } + + /** Returns the builder for the settings used for calls to deleteCollector. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteCollectorOperationSettings() { + return deleteCollectorOperationSettings; + } + + /** Returns the builder for the settings used for calls to resumeCollector. */ + public UnaryCallSettings.Builder resumeCollectorSettings() { + return resumeCollectorSettings; + } + + /** Returns the builder for the settings used for calls to resumeCollector. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + resumeCollectorOperationSettings() { + return resumeCollectorOperationSettings; + } + + /** Returns the builder for the settings used for calls to registerCollector. */ + public UnaryCallSettings.Builder + registerCollectorSettings() { + return registerCollectorSettings; + } + + /** Returns the builder for the settings used for calls to registerCollector. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + registerCollectorOperationSettings() { + return registerCollectorOperationSettings; + } + + /** Returns the builder for the settings used for calls to pauseCollector. */ + public UnaryCallSettings.Builder pauseCollectorSettings() { + return pauseCollectorSettings; + } + + /** Returns the builder for the settings used for calls to pauseCollector. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + pauseCollectorOperationSettings() { + return pauseCollectorOperationSettings; + } + + /** 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 RapidMigrationAssessmentStubSettings build() throws IOException { + return new RapidMigrationAssessmentStubSettings(this); + } + } +} diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockLocations.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockLocations.java new file mode 100644 index 000000000000..323662218117 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/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.rapidmigrationassessment.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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockLocationsImpl.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..c837f983befd --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/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.rapidmigrationassessment.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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessment.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessment.java new file mode 100644 index 000000000000..6d99dc1ce069 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessment.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.rapidmigrationassessment.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 MockRapidMigrationAssessment implements MockGrpcService { + private final MockRapidMigrationAssessmentImpl serviceImpl; + + public MockRapidMigrationAssessment() { + serviceImpl = new MockRapidMigrationAssessmentImpl(); + } + + @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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessmentImpl.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessmentImpl.java new file mode 100644 index 000000000000..36e2ddc8a208 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/MockRapidMigrationAssessmentImpl.java @@ -0,0 +1,271 @@ +/* + * 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.rapidmigrationassessment.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentGrpc.RapidMigrationAssessmentImplBase; +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 MockRapidMigrationAssessmentImpl extends RapidMigrationAssessmentImplBase { + private List requests; + private Queue responses; + + public MockRapidMigrationAssessmentImpl() { + 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 createCollector( + CreateCollectorRequest 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 CreateCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAnnotation( + CreateAnnotationRequest 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 CreateAnnotation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAnnotation( + GetAnnotationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Annotation) { + requests.add(request); + responseObserver.onNext(((Annotation) 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 GetAnnotation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Annotation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCollectors( + ListCollectorsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCollectorsResponse) { + requests.add(request); + responseObserver.onNext(((ListCollectorsResponse) 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 ListCollectors, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCollectorsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCollector( + GetCollectorRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Collector) { + requests.add(request); + responseObserver.onNext(((Collector) 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 GetCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Collector.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCollector( + UpdateCollectorRequest 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 UpdateCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCollector( + DeleteCollectorRequest 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 DeleteCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resumeCollector( + ResumeCollectorRequest 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 ResumeCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void registerCollector( + RegisterCollectorRequest 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 RegisterCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pauseCollector( + PauseCollectorRequest 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 PauseCollector, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientHttpJsonTest.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientHttpJsonTest.java new file mode 100644 index 000000000000..e399543377a6 --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientHttpJsonTest.java @@ -0,0 +1,1344 @@ +/* + * 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.rapidmigrationassessment.v1; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +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.rapidmigrationassessment.v1.stub.HttpJsonRapidMigrationAssessmentStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +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 RapidMigrationAssessmentClientHttpJsonTest { + private static MockHttpService mockService; + private static RapidMigrationAssessmentClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRapidMigrationAssessmentStub.getMethodDescriptors(), + RapidMigrationAssessmentSettings.getDefaultEndpoint()); + RapidMigrationAssessmentSettings settings = + RapidMigrationAssessmentSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RapidMigrationAssessmentSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RapidMigrationAssessmentClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + + Collector actualResponse = client.createCollectorAsync(parent, collector, collectorId).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 createCollectorExceptionTest() 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]"); + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + client.createCollectorAsync(parent, collector, collectorId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + + Collector actualResponse = client.createCollectorAsync(parent, collector, collectorId).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 createCollectorExceptionTest2() 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"; + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + client.createCollectorAsync(parent, collector, collectorId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createAnnotationTest() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAnnotationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Annotation annotation = Annotation.newBuilder().build(); + + Annotation actualResponse = client.createAnnotationAsync(parent, annotation).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 createAnnotationExceptionTest() 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]"); + Annotation annotation = Annotation.newBuilder().build(); + client.createAnnotationAsync(parent, annotation).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createAnnotationTest2() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAnnotationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Annotation annotation = Annotation.newBuilder().build(); + + Annotation actualResponse = client.createAnnotationAsync(parent, annotation).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 createAnnotationExceptionTest2() 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"; + Annotation annotation = Annotation.newBuilder().build(); + client.createAnnotationAsync(parent, annotation).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getAnnotationTest() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]"); + + Annotation actualResponse = client.getAnnotation(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 getAnnotationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]"); + client.getAnnotation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAnnotationTest2() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-1098/locations/location-1098/annotations/annotation-1098"; + + Annotation actualResponse = client.getAnnotation(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 getAnnotationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-1098/locations/location-1098/annotations/annotation-1098"; + client.getAnnotation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCollectorsTest() throws Exception { + Collector responsesElement = Collector.newBuilder().build(); + ListCollectorsResponse expectedResponse = + ListCollectorsResponse.newBuilder() + .setNextPageToken("") + .addAllCollectors(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCollectorsPagedResponse pagedListResponse = client.listCollectors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCollectorsList().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 listCollectorsExceptionTest() 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.listCollectors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCollectorsTest2() throws Exception { + Collector responsesElement = Collector.newBuilder().build(); + ListCollectorsResponse expectedResponse = + ListCollectorsResponse.newBuilder() + .setNextPageToken("") + .addAllCollectors(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListCollectorsPagedResponse pagedListResponse = client.listCollectors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCollectorsList().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 listCollectorsExceptionTest2() 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.listCollectors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + mockService.addResponse(expectedResponse); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.getCollector(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 getCollectorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.getCollector(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + + Collector actualResponse = client.getCollector(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 getCollectorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + client.getCollector(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Collector collector = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Collector actualResponse = client.updateCollectorAsync(collector, 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 updateCollectorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Collector collector = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCollectorAsync(collector, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.deleteCollectorAsync(name).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 deleteCollectorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.deleteCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + + Collector actualResponse = client.deleteCollectorAsync(name).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 deleteCollectorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + client.deleteCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void resumeCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("resumeCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.resumeCollectorAsync(name).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 resumeCollectorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.resumeCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void resumeCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("resumeCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + + Collector actualResponse = client.resumeCollectorAsync(name).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 resumeCollectorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + client.resumeCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void registerCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("registerCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.registerCollectorAsync(name).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 registerCollectorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.registerCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void registerCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("registerCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + + Collector actualResponse = client.registerCollectorAsync(name).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 registerCollectorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + client.registerCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void pauseCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("pauseCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.pauseCollectorAsync(name).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 pauseCollectorExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.pauseCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void pauseCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("pauseCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + + Collector actualResponse = client.pauseCollectorAsync(name).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 pauseCollectorExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2058/locations/location-2058/collectors/collector-2058"; + client.pauseCollectorAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @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-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientTest.java b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientTest.java new file mode 100644 index 000000000000..03d58d4415da --- /dev/null +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/src/test/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentClientTest.java @@ -0,0 +1,1236 @@ +/* + * 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.rapidmigrationassessment.v1; + +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListCollectorsPagedResponse; +import static com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient.ListLocationsPagedResponse; + +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.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +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 RapidMigrationAssessmentClientTest { + private static MockLocations mockLocations; + private static MockRapidMigrationAssessment mockRapidMigrationAssessment; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RapidMigrationAssessmentClient client; + + @BeforeClass + public static void startStaticServer() { + mockRapidMigrationAssessment = new MockRapidMigrationAssessment(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockRapidMigrationAssessment, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RapidMigrationAssessmentSettings settings = + RapidMigrationAssessmentSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RapidMigrationAssessmentClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + + Collector actualResponse = client.createCollectorAsync(parent, collector, collectorId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCollectorRequest actualRequest = ((CreateCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(collector, actualRequest.getCollector()); + Assert.assertEquals(collectorId, actualRequest.getCollectorId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + client.createCollectorAsync(parent, collector, collectorId).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 createCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + String parent = "parent-995424086"; + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + + Collector actualResponse = client.createCollectorAsync(parent, collector, collectorId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCollectorRequest actualRequest = ((CreateCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(collector, actualRequest.getCollector()); + Assert.assertEquals(collectorId, actualRequest.getCollectorId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCollectorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String parent = "parent-995424086"; + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + client.createCollectorAsync(parent, collector, collectorId).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 createAnnotationTest() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAnnotationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Annotation annotation = Annotation.newBuilder().build(); + + Annotation actualResponse = client.createAnnotationAsync(parent, annotation).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAnnotationRequest actualRequest = ((CreateAnnotationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(annotation, actualRequest.getAnnotation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAnnotationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Annotation annotation = Annotation.newBuilder().build(); + client.createAnnotationAsync(parent, annotation).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 createAnnotationTest2() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAnnotationTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + String parent = "parent-995424086"; + Annotation annotation = Annotation.newBuilder().build(); + + Annotation actualResponse = client.createAnnotationAsync(parent, annotation).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAnnotationRequest actualRequest = ((CreateAnnotationRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(annotation, actualRequest.getAnnotation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAnnotationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String parent = "parent-995424086"; + Annotation annotation = Annotation.newBuilder().build(); + client.createAnnotationAsync(parent, annotation).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 getAnnotationTest() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockRapidMigrationAssessment.addResponse(expectedResponse); + + AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]"); + + Annotation actualResponse = client.getAnnotation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAnnotationRequest actualRequest = ((GetAnnotationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAnnotationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]"); + client.getAnnotation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAnnotationTest2() throws Exception { + Annotation expectedResponse = + Annotation.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .build(); + mockRapidMigrationAssessment.addResponse(expectedResponse); + + String name = "name3373707"; + + Annotation actualResponse = client.getAnnotation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAnnotationRequest actualRequest = ((GetAnnotationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAnnotationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String name = "name3373707"; + client.getAnnotation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCollectorsTest() throws Exception { + Collector responsesElement = Collector.newBuilder().build(); + ListCollectorsResponse expectedResponse = + ListCollectorsResponse.newBuilder() + .setNextPageToken("") + .addAllCollectors(Arrays.asList(responsesElement)) + .build(); + mockRapidMigrationAssessment.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCollectorsPagedResponse pagedListResponse = client.listCollectors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCollectorsList().get(0), resources.get(0)); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCollectorsRequest actualRequest = ((ListCollectorsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCollectorsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCollectors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCollectorsTest2() throws Exception { + Collector responsesElement = Collector.newBuilder().build(); + ListCollectorsResponse expectedResponse = + ListCollectorsResponse.newBuilder() + .setNextPageToken("") + .addAllCollectors(Arrays.asList(responsesElement)) + .build(); + mockRapidMigrationAssessment.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCollectorsPagedResponse pagedListResponse = client.listCollectors(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCollectorsList().get(0), resources.get(0)); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCollectorsRequest actualRequest = ((ListCollectorsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCollectorsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCollectors(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + mockRapidMigrationAssessment.addResponse(expectedResponse); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.getCollector(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCollectorRequest actualRequest = ((GetCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.getCollector(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + mockRapidMigrationAssessment.addResponse(expectedResponse); + + String name = "name3373707"; + + Collector actualResponse = client.getCollector(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCollectorRequest actualRequest = ((GetCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCollectorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String name = "name3373707"; + client.getCollector(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + Collector collector = Collector.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Collector actualResponse = client.updateCollectorAsync(collector, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCollectorRequest actualRequest = ((UpdateCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(collector, actualRequest.getCollector()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + Collector collector = Collector.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCollectorAsync(collector, 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 deleteCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.deleteCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCollectorRequest actualRequest = ((DeleteCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.deleteCollectorAsync(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 deleteCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + String name = "name3373707"; + + Collector actualResponse = client.deleteCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCollectorRequest actualRequest = ((DeleteCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCollectorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String name = "name3373707"; + client.deleteCollectorAsync(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 resumeCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("resumeCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.resumeCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResumeCollectorRequest actualRequest = ((ResumeCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resumeCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.resumeCollectorAsync(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 resumeCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("resumeCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + String name = "name3373707"; + + Collector actualResponse = client.resumeCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResumeCollectorRequest actualRequest = ((ResumeCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resumeCollectorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String name = "name3373707"; + client.resumeCollectorAsync(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 registerCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("registerCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.registerCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RegisterCollectorRequest actualRequest = ((RegisterCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void registerCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.registerCollectorAsync(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 registerCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("registerCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + String name = "name3373707"; + + Collector actualResponse = client.registerCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RegisterCollectorRequest actualRequest = ((RegisterCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void registerCollectorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String name = "name3373707"; + client.registerCollectorAsync(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 pauseCollectorTest() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("pauseCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + + Collector actualResponse = client.pauseCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PauseCollectorRequest actualRequest = ((PauseCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pauseCollectorExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + client.pauseCollectorAsync(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 pauseCollectorTest2() throws Exception { + Collector expectedResponse = + Collector.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .setServiceAccount("serviceAccount1079137720") + .setBucket("bucket-1378203158") + .setExpectedAssetCount(290454521) + .setClientVersion("clientVersion771880589") + .setGuestOsScan(GuestOsScan.newBuilder().build()) + .setVsphereScan(VSphereScan.newBuilder().build()) + .setCollectionDays(1060007256) + .setEulaUri("eulaUri-1399082745") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("pauseCollectorTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockRapidMigrationAssessment.addResponse(resultOperation); + + String name = "name3373707"; + + Collector actualResponse = client.pauseCollectorAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRapidMigrationAssessment.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PauseCollectorRequest actualRequest = ((PauseCollectorRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pauseCollectorExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRapidMigrationAssessment.addException(exception); + + try { + String name = "name3373707"; + client.pauseCollectorAsync(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 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-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/pom.xml b/java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/pom.xml new file mode 100644 index 000000000000..ebb45a57dfd2 --- /dev/null +++ b/java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-rapidmigrationassessment-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-rapidmigrationassessment-v1 + GRPC library for google-cloud-rapidmigrationassessment + + com.google.cloud + google-cloud-rapidmigrationassessment-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-rapidmigrationassessment-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentGrpc.java b/java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentGrpc.java new file mode 100644 index 000000000000..af38ea7629a8 --- /dev/null +++ b/java-rapidmigrationassessment/grpc-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentGrpc.java @@ -0,0 +1,1459 @@ +/* + * 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.rapidmigrationassessment.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Rapid Migration Assessment service
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RapidMigrationAssessmentGrpc { + + private RapidMigrationAssessmentGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessment"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest, + com.google.longrunning.Operation> + getCreateCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest, + com.google.longrunning.Operation> + getCreateCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest, + com.google.longrunning.Operation> + getCreateCollectorMethod; + if ((getCreateCollectorMethod = RapidMigrationAssessmentGrpc.getCreateCollectorMethod) + == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getCreateCollectorMethod = RapidMigrationAssessmentGrpc.getCreateCollectorMethod) + == null) { + RapidMigrationAssessmentGrpc.getCreateCollectorMethod = + getCreateCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("CreateCollector")) + .build(); + } + } + } + return getCreateCollectorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest, + com.google.longrunning.Operation> + getCreateAnnotationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAnnotation", + requestType = com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest, + com.google.longrunning.Operation> + getCreateAnnotationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest, + com.google.longrunning.Operation> + getCreateAnnotationMethod; + if ((getCreateAnnotationMethod = RapidMigrationAssessmentGrpc.getCreateAnnotationMethod) + == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getCreateAnnotationMethod = RapidMigrationAssessmentGrpc.getCreateAnnotationMethod) + == null) { + RapidMigrationAssessmentGrpc.getCreateAnnotationMethod = + getCreateAnnotationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAnnotation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("CreateAnnotation")) + .build(); + } + } + } + return getCreateAnnotationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest, + com.google.cloud.rapidmigrationassessment.v1.Annotation> + getGetAnnotationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAnnotation", + requestType = com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.class, + responseType = com.google.cloud.rapidmigrationassessment.v1.Annotation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest, + com.google.cloud.rapidmigrationassessment.v1.Annotation> + getGetAnnotationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest, + com.google.cloud.rapidmigrationassessment.v1.Annotation> + getGetAnnotationMethod; + if ((getGetAnnotationMethod = RapidMigrationAssessmentGrpc.getGetAnnotationMethod) == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getGetAnnotationMethod = RapidMigrationAssessmentGrpc.getGetAnnotationMethod) + == null) { + RapidMigrationAssessmentGrpc.getGetAnnotationMethod = + getGetAnnotationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAnnotation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.Annotation + .getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("GetAnnotation")) + .build(); + } + } + } + return getGetAnnotationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse> + getListCollectorsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCollectors", + requestType = com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.class, + responseType = com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse> + getListCollectorsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse> + getListCollectorsMethod; + if ((getListCollectorsMethod = RapidMigrationAssessmentGrpc.getListCollectorsMethod) == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getListCollectorsMethod = RapidMigrationAssessmentGrpc.getListCollectorsMethod) + == null) { + RapidMigrationAssessmentGrpc.getListCollectorsMethod = + getListCollectorsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCollectors")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("ListCollectors")) + .build(); + } + } + } + return getListCollectorsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest, + com.google.cloud.rapidmigrationassessment.v1.Collector> + getGetCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.class, + responseType = com.google.cloud.rapidmigrationassessment.v1.Collector.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest, + com.google.cloud.rapidmigrationassessment.v1.Collector> + getGetCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest, + com.google.cloud.rapidmigrationassessment.v1.Collector> + getGetCollectorMethod; + if ((getGetCollectorMethod = RapidMigrationAssessmentGrpc.getGetCollectorMethod) == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getGetCollectorMethod = RapidMigrationAssessmentGrpc.getGetCollectorMethod) == null) { + RapidMigrationAssessmentGrpc.getGetCollectorMethod = + getGetCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.Collector + .getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("GetCollector")) + .build(); + } + } + } + return getGetCollectorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest, + com.google.longrunning.Operation> + getUpdateCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest, + com.google.longrunning.Operation> + getUpdateCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest, + com.google.longrunning.Operation> + getUpdateCollectorMethod; + if ((getUpdateCollectorMethod = RapidMigrationAssessmentGrpc.getUpdateCollectorMethod) + == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getUpdateCollectorMethod = RapidMigrationAssessmentGrpc.getUpdateCollectorMethod) + == null) { + RapidMigrationAssessmentGrpc.getUpdateCollectorMethod = + getUpdateCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("UpdateCollector")) + .build(); + } + } + } + return getUpdateCollectorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest, + com.google.longrunning.Operation> + getDeleteCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest, + com.google.longrunning.Operation> + getDeleteCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest, + com.google.longrunning.Operation> + getDeleteCollectorMethod; + if ((getDeleteCollectorMethod = RapidMigrationAssessmentGrpc.getDeleteCollectorMethod) + == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getDeleteCollectorMethod = RapidMigrationAssessmentGrpc.getDeleteCollectorMethod) + == null) { + RapidMigrationAssessmentGrpc.getDeleteCollectorMethod = + getDeleteCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("DeleteCollector")) + .build(); + } + } + } + return getDeleteCollectorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest, + com.google.longrunning.Operation> + getResumeCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResumeCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest, + com.google.longrunning.Operation> + getResumeCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest, + com.google.longrunning.Operation> + getResumeCollectorMethod; + if ((getResumeCollectorMethod = RapidMigrationAssessmentGrpc.getResumeCollectorMethod) + == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getResumeCollectorMethod = RapidMigrationAssessmentGrpc.getResumeCollectorMethod) + == null) { + RapidMigrationAssessmentGrpc.getResumeCollectorMethod = + getResumeCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResumeCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("ResumeCollector")) + .build(); + } + } + } + return getResumeCollectorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest, + com.google.longrunning.Operation> + getRegisterCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RegisterCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest, + com.google.longrunning.Operation> + getRegisterCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest, + com.google.longrunning.Operation> + getRegisterCollectorMethod; + if ((getRegisterCollectorMethod = RapidMigrationAssessmentGrpc.getRegisterCollectorMethod) + == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getRegisterCollectorMethod = RapidMigrationAssessmentGrpc.getRegisterCollectorMethod) + == null) { + RapidMigrationAssessmentGrpc.getRegisterCollectorMethod = + getRegisterCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RegisterCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("RegisterCollector")) + .build(); + } + } + } + return getRegisterCollectorMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest, + com.google.longrunning.Operation> + getPauseCollectorMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PauseCollector", + requestType = com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest, + com.google.longrunning.Operation> + getPauseCollectorMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest, + com.google.longrunning.Operation> + getPauseCollectorMethod; + if ((getPauseCollectorMethod = RapidMigrationAssessmentGrpc.getPauseCollectorMethod) == null) { + synchronized (RapidMigrationAssessmentGrpc.class) { + if ((getPauseCollectorMethod = RapidMigrationAssessmentGrpc.getPauseCollectorMethod) + == null) { + RapidMigrationAssessmentGrpc.getPauseCollectorMethod = + getPauseCollectorMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PauseCollector")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new RapidMigrationAssessmentMethodDescriptorSupplier("PauseCollector")) + .build(); + } + } + } + return getPauseCollectorMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RapidMigrationAssessmentStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RapidMigrationAssessmentStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RapidMigrationAssessmentStub(channel, callOptions); + } + }; + return RapidMigrationAssessmentStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RapidMigrationAssessmentBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RapidMigrationAssessmentBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RapidMigrationAssessmentBlockingStub(channel, callOptions); + } + }; + return RapidMigrationAssessmentBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RapidMigrationAssessmentFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RapidMigrationAssessmentFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RapidMigrationAssessmentFutureStub(channel, callOptions); + } + }; + return RapidMigrationAssessmentFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Rapid Migration Assessment service
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Create a Collector to manage the on-prem appliance which collects
+     * information about Customer assets.
+     * 
+ */ + default void createCollector( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateCollectorMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates an Annotation
+     * 
+ */ + default void createAnnotation( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAnnotationMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Annotation.
+     * 
+ */ + default void getAnnotation( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetAnnotationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists Collectors in a given project and location.
+     * 
+ */ + default void listCollectors( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListCollectorsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Collector.
+     * 
+ */ + default void getCollector( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCollectorMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Collector.
+     * 
+ */ + default void updateCollector( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateCollectorMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single Collector - changes state of collector to "Deleting".
+     * 
+ */ + default void deleteCollector( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteCollectorMethod(), responseObserver); + } + + /** + * + * + *
+     * Resumes the given collector.
+     * 
+ */ + default void resumeCollector( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResumeCollectorMethod(), responseObserver); + } + + /** + * + * + *
+     * Registers the given collector.
+     * 
+ */ + default void registerCollector( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRegisterCollectorMethod(), responseObserver); + } + + /** + * + * + *
+     * Pauses the given collector.
+     * 
+ */ + default void pauseCollector( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPauseCollectorMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service RapidMigrationAssessment. + * + *
+   * Rapid Migration Assessment service
+   * 
+ */ + public abstract static class RapidMigrationAssessmentImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return RapidMigrationAssessmentGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service RapidMigrationAssessment. + * + *
+   * Rapid Migration Assessment service
+   * 
+ */ + public static final class RapidMigrationAssessmentStub + extends io.grpc.stub.AbstractAsyncStub { + private RapidMigrationAssessmentStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RapidMigrationAssessmentStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RapidMigrationAssessmentStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a Collector to manage the on-prem appliance which collects
+     * information about Customer assets.
+     * 
+ */ + public void createCollector( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates an Annotation
+     * 
+ */ + public void createAnnotation( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAnnotationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Annotation.
+     * 
+ */ + public void getAnnotation( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAnnotationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists Collectors in a given project and location.
+     * 
+ */ + public void listCollectors( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCollectorsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Collector.
+     * 
+ */ + public void getCollector( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single Collector.
+     * 
+ */ + public void updateCollector( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single Collector - changes state of collector to "Deleting".
+     * 
+ */ + public void deleteCollector( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Resumes the given collector.
+     * 
+ */ + public void resumeCollector( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResumeCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Registers the given collector.
+     * 
+ */ + public void registerCollector( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRegisterCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Pauses the given collector.
+     * 
+ */ + public void pauseCollector( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPauseCollectorMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service RapidMigrationAssessment. + * + *
+   * Rapid Migration Assessment service
+   * 
+ */ + public static final class RapidMigrationAssessmentBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RapidMigrationAssessmentBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RapidMigrationAssessmentBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RapidMigrationAssessmentBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a Collector to manage the on-prem appliance which collects
+     * information about Customer assets.
+     * 
+ */ + public com.google.longrunning.Operation createCollector( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateCollectorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates an Annotation
+     * 
+ */ + public com.google.longrunning.Operation createAnnotation( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAnnotationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Annotation.
+     * 
+ */ + public com.google.cloud.rapidmigrationassessment.v1.Annotation getAnnotation( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAnnotationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists Collectors in a given project and location.
+     * 
+ */ + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse listCollectors( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCollectorsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Collector.
+     * 
+ */ + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollector( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCollectorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Collector.
+     * 
+ */ + public com.google.longrunning.Operation updateCollector( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCollectorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single Collector - changes state of collector to "Deleting".
+     * 
+ */ + public com.google.longrunning.Operation deleteCollector( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteCollectorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Resumes the given collector.
+     * 
+ */ + public com.google.longrunning.Operation resumeCollector( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResumeCollectorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Registers the given collector.
+     * 
+ */ + public com.google.longrunning.Operation registerCollector( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRegisterCollectorMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Pauses the given collector.
+     * 
+ */ + public com.google.longrunning.Operation pauseCollector( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPauseCollectorMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * RapidMigrationAssessment. + * + *
+   * Rapid Migration Assessment service
+   * 
+ */ + public static final class RapidMigrationAssessmentFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RapidMigrationAssessmentFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RapidMigrationAssessmentFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RapidMigrationAssessmentFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Create a Collector to manage the on-prem appliance which collects
+     * information about Customer assets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCollector( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateCollectorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates an Annotation
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createAnnotation( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAnnotationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Annotation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.rapidmigrationassessment.v1.Annotation> + getAnnotation(com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAnnotationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists Collectors in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse> + listCollectors(com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCollectorsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Collector.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.rapidmigrationassessment.v1.Collector> + getCollector(com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCollectorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single Collector.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCollector( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCollectorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single Collector - changes state of collector to "Deleting".
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCollector( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteCollectorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Resumes the given collector.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + resumeCollector( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResumeCollectorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Registers the given collector.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + registerCollector( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRegisterCollectorMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Pauses the given collector.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + pauseCollector(com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPauseCollectorMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_COLLECTOR = 0; + private static final int METHODID_CREATE_ANNOTATION = 1; + private static final int METHODID_GET_ANNOTATION = 2; + private static final int METHODID_LIST_COLLECTORS = 3; + private static final int METHODID_GET_COLLECTOR = 4; + private static final int METHODID_UPDATE_COLLECTOR = 5; + private static final int METHODID_DELETE_COLLECTOR = 6; + private static final int METHODID_RESUME_COLLECTOR = 7; + private static final int METHODID_REGISTER_COLLECTOR = 8; + private static final int METHODID_PAUSE_COLLECTOR = 9; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_COLLECTOR: + serviceImpl.createCollector( + (com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_ANNOTATION: + serviceImpl.createAnnotation( + (com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_ANNOTATION: + serviceImpl.getAnnotation( + (com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_COLLECTORS: + serviceImpl.listCollectors( + (com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse>) + responseObserver); + break; + case METHODID_GET_COLLECTOR: + serviceImpl.getCollector( + (com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_COLLECTOR: + serviceImpl.updateCollector( + (com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_COLLECTOR: + serviceImpl.deleteCollector( + (com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESUME_COLLECTOR: + serviceImpl.resumeCollector( + (com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_REGISTER_COLLECTOR: + serviceImpl.registerCollector( + (com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PAUSE_COLLECTOR: + serviceImpl.pauseCollector( + (com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_COLLECTOR))) + .addMethod( + getCreateAnnotationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_ANNOTATION))) + .addMethod( + getGetAnnotationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest, + com.google.cloud.rapidmigrationassessment.v1.Annotation>( + service, METHODID_GET_ANNOTATION))) + .addMethod( + getListCollectorsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse>( + service, METHODID_LIST_COLLECTORS))) + .addMethod( + getGetCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest, + com.google.cloud.rapidmigrationassessment.v1.Collector>( + service, METHODID_GET_COLLECTOR))) + .addMethod( + getUpdateCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_COLLECTOR))) + .addMethod( + getDeleteCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_COLLECTOR))) + .addMethod( + getResumeCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest, + com.google.longrunning.Operation>(service, METHODID_RESUME_COLLECTOR))) + .addMethod( + getRegisterCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest, + com.google.longrunning.Operation>(service, METHODID_REGISTER_COLLECTOR))) + .addMethod( + getPauseCollectorMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest, + com.google.longrunning.Operation>(service, METHODID_PAUSE_COLLECTOR))) + .build(); + } + + private abstract static class RapidMigrationAssessmentBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RapidMigrationAssessmentBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RapidMigrationAssessment"); + } + } + + private static final class RapidMigrationAssessmentFileDescriptorSupplier + extends RapidMigrationAssessmentBaseDescriptorSupplier { + RapidMigrationAssessmentFileDescriptorSupplier() {} + } + + private static final class RapidMigrationAssessmentMethodDescriptorSupplier + extends RapidMigrationAssessmentBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RapidMigrationAssessmentMethodDescriptorSupplier(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 (RapidMigrationAssessmentGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RapidMigrationAssessmentFileDescriptorSupplier()) + .addMethod(getCreateCollectorMethod()) + .addMethod(getCreateAnnotationMethod()) + .addMethod(getGetAnnotationMethod()) + .addMethod(getListCollectorsMethod()) + .addMethod(getGetCollectorMethod()) + .addMethod(getUpdateCollectorMethod()) + .addMethod(getDeleteCollectorMethod()) + .addMethod(getResumeCollectorMethod()) + .addMethod(getRegisterCollectorMethod()) + .addMethod(getPauseCollectorMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-rapidmigrationassessment/owlbot.py b/java-rapidmigrationassessment/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-rapidmigrationassessment/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-rapidmigrationassessment/pom.xml b/java-rapidmigrationassessment/pom.xml new file mode 100644 index 000000000000..721ef2cd64af --- /dev/null +++ b/java-rapidmigrationassessment/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.google.cloud + google-cloud-rapidmigrationassessment-parent + pom + 0.0.1-SNAPSHOT + Google Rapid Migration Assessment API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.12.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-rapidmigrationassessment-parent + + + + + + com.google.cloud + google-cloud-rapidmigrationassessment + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-rapidmigrationassessment-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-rapidmigrationassessment-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-rapidmigrationassessment + grpc-google-cloud-rapidmigrationassessment-v1 + proto-google-cloud-rapidmigrationassessment-v1 + google-cloud-rapidmigrationassessment-bom + + diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/clirr-ignored-differences.xml b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..51cbed012514 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/rapidmigrationassessment/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/rapidmigrationassessment/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/rapidmigrationassessment/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/pom.xml b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/pom.xml new file mode 100644 index 000000000000..eb73b456037e --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-rapidmigrationassessment-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-rapidmigrationassessment-v1 + Proto library for google-cloud-rapidmigrationassessment + + com.google.cloud + google-cloud-rapidmigrationassessment-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Annotation.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Annotation.java new file mode 100644 index 000000000000..c329f0c911a7 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Annotation.java @@ -0,0 +1,1801 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message describing an Annotation
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.Annotation} + */ +public final class Annotation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.Annotation) + AnnotationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Annotation.newBuilder() to construct. + private Annotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Annotation() { + name_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Annotation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.Annotation.class, + com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder.class); + } + + /** + * + * + *
+   * Types for project level setting.
+   * 
+ * + * Protobuf enum {@code google.cloud.rapidmigrationassessment.v1.Annotation.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown type
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates that this project has opted into StratoZone export.
+     * 
+ * + * TYPE_LEGACY_EXPORT_CONSENT = 1; + */ + TYPE_LEGACY_EXPORT_CONSENT(1), + /** + * + * + *
+     * Indicates that this project is created by Qwiklab.
+     * 
+ * + * TYPE_QWIKLAB = 2; + */ + TYPE_QWIKLAB(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown type
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates that this project has opted into StratoZone export.
+     * 
+ * + * TYPE_LEGACY_EXPORT_CONSENT = 1; + */ + public static final int TYPE_LEGACY_EXPORT_CONSENT_VALUE = 1; + /** + * + * + *
+     * Indicates that this project is created by Qwiklab.
+     * 
+ * + * TYPE_QWIKLAB = 2; + */ + public static final int TYPE_QWIKLAB_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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return TYPE_LEGACY_EXPORT_CONSENT; + case 2: + return TYPE_QWIKLAB; + 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 Type findValueByNumber(int number) { + return Type.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.rapidmigrationassessment.v1.Annotation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.rapidmigrationassessment.v1.Annotation.Type) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * name of resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * name of resource.
+   * 
+ * + * 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 CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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(); + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @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(); + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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; + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @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 TYPE_FIELD_NUMBER = 5; + private int type_ = 0; + /** + * + * + *
+   * Type of an annotation.
+   * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Type of an annotation.
+   * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Annotation.Type getType() { + com.google.cloud.rapidmigrationassessment.v1.Annotation.Type result = + com.google.cloud.rapidmigrationassessment.v1.Annotation.Type.forNumber(type_); + return result == null + ? com.google.cloud.rapidmigrationassessment.v1.Annotation.Type.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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (type_ + != com.google.cloud.rapidmigrationassessment.v1.Annotation.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + 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(4, labels__); + } + if (type_ + != com.google.cloud.rapidmigrationassessment.v1.Annotation.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, 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.rapidmigrationassessment.v1.Annotation)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.Annotation other = + (com.google.cloud.rapidmigrationassessment.v1.Annotation) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (type_ != other.type_) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation 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.rapidmigrationassessment.v1.Annotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation 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.rapidmigrationassessment.v1.Annotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation 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.rapidmigrationassessment.v1.Annotation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation 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.rapidmigrationassessment.v1.Annotation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation 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.rapidmigrationassessment.v1.Annotation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing an Annotation
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.Annotation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.Annotation) + com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.Annotation.class, + com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder.class); + } + + // Construct using com.google.cloud.rapidmigrationassessment.v1.Annotation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + type_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Annotation getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Annotation build() { + com.google.cloud.rapidmigrationassessment.v1.Annotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Annotation buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.Annotation result = + new com.google.cloud.rapidmigrationassessment.v1.Annotation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.rapidmigrationassessment.v1.Annotation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.type_ = type_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.Annotation) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.Annotation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.rapidmigrationassessment.v1.Annotation other) { + if (other == com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + 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_ = ""; + /** + * + * + *
+     * name of resource.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + 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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @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(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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; + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @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() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + 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() { + bitField0_ |= 0x00000008; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + 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); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Type of an annotation.
+     * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of an annotation.
+     * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of an annotation.
+     * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Annotation.Type getType() { + com.google.cloud.rapidmigrationassessment.v1.Annotation.Type result = + com.google.cloud.rapidmigrationassessment.v1.Annotation.Type.forNumber(type_); + return result == null + ? com.google.cloud.rapidmigrationassessment.v1.Annotation.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of an annotation.
+     * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.rapidmigrationassessment.v1.Annotation.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of an annotation.
+     * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000010); + type_ = 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.rapidmigrationassessment.v1.Annotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.Annotation) + private static final com.google.cloud.rapidmigrationassessment.v1.Annotation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.Annotation(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Annotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Annotation 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.rapidmigrationassessment.v1.Annotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationName.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationName.java new file mode 100644 index 000000000000..98a5b02773fd --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationName.java @@ -0,0 +1,223 @@ +/* + * 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.rapidmigrationassessment.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class AnnotationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_ANNOTATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/annotations/{annotation}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String annotation; + + @Deprecated + protected AnnotationName() { + project = null; + location = null; + annotation = null; + } + + private AnnotationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + annotation = Preconditions.checkNotNull(builder.getAnnotation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAnnotation() { + return annotation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AnnotationName of(String project, String location, String annotation) { + return newBuilder().setProject(project).setLocation(location).setAnnotation(annotation).build(); + } + + public static String format(String project, String location, String annotation) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setAnnotation(annotation) + .build() + .toString(); + } + + public static AnnotationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_ANNOTATION.validatedMatch( + formattedString, "AnnotationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("annotation")); + } + + 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 (AnnotationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_ANNOTATION.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 (annotation != null) { + fieldMapBuilder.put("annotation", annotation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_ANNOTATION.instantiate( + "project", project, "location", location, "annotation", annotation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AnnotationName that = ((AnnotationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.annotation, that.annotation); + } + 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(annotation); + return h; + } + + /** Builder for projects/{project}/locations/{location}/annotations/{annotation}. */ + public static class Builder { + private String project; + private String location; + private String annotation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getAnnotation() { + return annotation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setAnnotation(String annotation) { + this.annotation = annotation; + return this; + } + + private Builder(AnnotationName annotationName) { + this.project = annotationName.project; + this.location = annotationName.location; + this.annotation = annotationName.annotation; + } + + public AnnotationName build() { + return new AnnotationName(this); + } + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationOrBuilder.java new file mode 100644 index 000000000000..f4d1a358c675 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/AnnotationOrBuilder.java @@ -0,0 +1,209 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface AnnotationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.Annotation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * name of resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * name of resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Type of an annotation.
+   * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Type of an annotation.
+   * 
+ * + * .google.cloud.rapidmigrationassessment.v1.Annotation.Type type = 5; + * + * @return The type. + */ + com.google.cloud.rapidmigrationassessment.v1.Annotation.Type getType(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ApiEntitiesProto.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ApiEntitiesProto.java new file mode 100644 index 000000000000..9e62885c4aed --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ApiEntitiesProto.java @@ -0,0 +1,204 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public final class ApiEntitiesProto { + private ApiEntitiesProto() {} + + 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_rapidmigrationassessment_v1_GuestOsScan_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_LabelsEntry_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/rapidmigrationassessment/" + + "v1/api_entities.proto\022(google.cloud.rapi" + + "dmigrationassessment.v1\032\037google/api/fiel" + + "d_behavior.proto\032\031google/api/resource.pr" + + "oto\032\037google/protobuf/timestamp.proto\"\"\n\013" + + "GuestOsScan\022\023\n\013core_source\030\001 \001(\t\"\"\n\013VSph" + + "ereScan\022\023\n\013core_source\030\001 \001(\t\"\201\010\n\tCollect" + + "or\022\014\n\004name\030\001 \001(\t\0225\n\013create_time\030\002 \001(\0132\032." + + "google.protobuf.TimestampB\004\342A\001\003\0225\n\013updat" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "B\004\342A\001\003\022O\n\006labels\030\004 \003(\0132?.google.cloud.ra" + + "pidmigrationassessment.v1.Collector.Labe" + + "lsEntry\022\024\n\014display_name\030\005 \001(\t\022\023\n\013descrip" + + "tion\030\006 \001(\t\022\027\n\017service_account\030\007 \001(\t\022\024\n\006b" + + "ucket\030\010 \001(\tB\004\342A\001\003\022\034\n\024expected_asset_coun" + + "t\030\t \001(\003\022N\n\005state\030\n \001(\01629.google.cloud.ra" + + "pidmigrationassessment.v1.Collector.Stat" + + "eB\004\342A\001\003\022\034\n\016client_version\030\013 \001(\tB\004\342A\001\003\022R\n" + + "\rguest_os_scan\030\014 \001(\01325.google.cloud.rapi" + + "dmigrationassessment.v1.GuestOsScanB\004\342A\001" + + "\003\022Q\n\014vsphere_scan\030\r \001(\01325.google.cloud.r" + + "apidmigrationassessment.v1.VSphereScanB\004" + + "\342A\001\003\022\027\n\017collection_days\030\016 \001(\005\022\020\n\010eula_ur" + + "i\030\017 \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001\"\307\001\n\005State\022\025\n\021STATE_UNSPEC" + + "IFIED\020\000\022\026\n\022STATE_INITIALIZING\020\001\022\026\n\022STATE" + + "_READY_TO_USE\020\002\022\024\n\020STATE_REGISTERED\020\003\022\020\n" + + "\014STATE_ACTIVE\020\004\022\020\n\014STATE_PAUSED\020\005\022\022\n\016STA" + + "TE_DELETING\020\006\022\030\n\024STATE_DECOMMISSIONED\020\007\022" + + "\017\n\013STATE_ERROR\020\010:v\352As\n1rapidmigrationass" + + "essment.googleapis.com/Collector\022>projec" + + "ts/{project}/locations/{location}/collec" + + "tors/{collector}\"\235\004\n\nAnnotation\022\014\n\004name\030" + + "\001 \001(\t\0225\n\013create_time\030\002 \001(\0132\032.google.prot" + + "obuf.TimestampB\004\342A\001\003\0225\n\013update_time\030\003 \001(" + + "\0132\032.google.protobuf.TimestampB\004\342A\001\003\022P\n\006l" + + "abels\030\004 \003(\0132@.google.cloud.rapidmigratio" + + "nassessment.v1.Annotation.LabelsEntry\022G\n" + + "\004type\030\005 \001(\01629.google.cloud.rapidmigratio" + + "nassessment.v1.Annotation.Type\032-\n\013Labels" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"N\n" + + "\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\036\n\032TYPE_LEGA" + + "CY_EXPORT_CONSENT\020\001\022\020\n\014TYPE_QWIKLAB\020\002:y\352" + + "Av\n2rapidmigrationassessment.googleapis." + + "com/Annotation\022@projects/{project}/locat" + + "ions/{location}/annotations/{annotation}" + + "B\260\002\n,com.google.cloud.rapidmigrationasse" + + "ssment.v1B\020ApiEntitiesProtoP\001Zhcloud.goo" + + "gle.com/go/rapidmigrationassessment/apiv" + + "1/rapidmigrationassessmentpb;rapidmigrat" + + "ionassessmentpb\252\002(Google.Cloud.RapidMigr" + + "ationAssessment.V1\312\002(Google\\Cloud\\RapidM" + + "igrationAssessment\\V1\352\002+Google::Cloud::R" + + "apidMigrationAssessment::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_descriptor, + new java.lang.String[] { + "CoreSource", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_descriptor, + new java.lang.String[] { + "CoreSource", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "DisplayName", + "Description", + "ServiceAccount", + "Bucket", + "ExpectedAssetCount", + "State", + "ClientVersion", + "GuestOsScan", + "VsphereScan", + "CollectionDays", + "EulaUri", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_LabelsEntry_descriptor = + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_Collector_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor, + new java.lang.String[] { + "Name", "CreateTime", "UpdateTime", "Labels", "Type", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_LabelsEntry_descriptor = + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_Annotation_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Collector.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Collector.java new file mode 100644 index 000000000000..619cbcdb7458 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/Collector.java @@ -0,0 +1,3831 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message describing Collector object.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.Collector} + */ +public final class Collector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.Collector) + CollectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Collector.newBuilder() to construct. + private Collector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Collector() { + name_ = ""; + displayName_ = ""; + description_ = ""; + serviceAccount_ = ""; + bucket_ = ""; + state_ = 0; + clientVersion_ = ""; + eulaUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Collector(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Collector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.Collector.class, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder.class); + } + + /** + * + * + *
+   * -- Using suggestion from API Linter Analyzer for nesting enum --
+   * -- https://linter.aip.dev/216/nesting --
+   * State of a Collector (server_side).
+   * States are used for internal purposes and named to keep
+   * convention of legacy product:
+   * https://cloud.google.com/migrate/stratozone/docs/about-stratoprobe.
+   * 
+ * + * Protobuf enum {@code google.cloud.rapidmigrationassessment.v1.Collector.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Collector state is not recognized.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Collector started to create, but hasn't been completed MC source creation
+     * and db object creation.
+     * 
+ * + * STATE_INITIALIZING = 1; + */ + STATE_INITIALIZING(1), + /** + * + * + *
+     * Collector has been created, MC source creation and db object creation
+     * completed.
+     * 
+ * + * STATE_READY_TO_USE = 2; + */ + STATE_READY_TO_USE(2), + /** + * + * + *
+     * Collector client has been registered with client.
+     * 
+ * + * STATE_REGISTERED = 3; + */ + STATE_REGISTERED(3), + /** + * + * + *
+     * Collector client is actively scanning.
+     * 
+ * + * STATE_ACTIVE = 4; + */ + STATE_ACTIVE(4), + /** + * + * + *
+     * Collector is not actively scanning.
+     * 
+ * + * STATE_PAUSED = 5; + */ + STATE_PAUSED(5), + /** + * + * + *
+     * Collector is starting background job for deletion.
+     * 
+ * + * STATE_DELETING = 6; + */ + STATE_DELETING(6), + /** + * + * + *
+     * Collector completed all tasks for deletion.
+     * 
+ * + * STATE_DECOMMISSIONED = 7; + */ + STATE_DECOMMISSIONED(7), + /** + * + * + *
+     * Collector is in error state.
+     * 
+ * + * STATE_ERROR = 8; + */ + STATE_ERROR(8), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Collector state is not recognized.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Collector started to create, but hasn't been completed MC source creation
+     * and db object creation.
+     * 
+ * + * STATE_INITIALIZING = 1; + */ + public static final int STATE_INITIALIZING_VALUE = 1; + /** + * + * + *
+     * Collector has been created, MC source creation and db object creation
+     * completed.
+     * 
+ * + * STATE_READY_TO_USE = 2; + */ + public static final int STATE_READY_TO_USE_VALUE = 2; + /** + * + * + *
+     * Collector client has been registered with client.
+     * 
+ * + * STATE_REGISTERED = 3; + */ + public static final int STATE_REGISTERED_VALUE = 3; + /** + * + * + *
+     * Collector client is actively scanning.
+     * 
+ * + * STATE_ACTIVE = 4; + */ + public static final int STATE_ACTIVE_VALUE = 4; + /** + * + * + *
+     * Collector is not actively scanning.
+     * 
+ * + * STATE_PAUSED = 5; + */ + public static final int STATE_PAUSED_VALUE = 5; + /** + * + * + *
+     * Collector is starting background job for deletion.
+     * 
+ * + * STATE_DELETING = 6; + */ + public static final int STATE_DELETING_VALUE = 6; + /** + * + * + *
+     * Collector completed all tasks for deletion.
+     * 
+ * + * STATE_DECOMMISSIONED = 7; + */ + public static final int STATE_DECOMMISSIONED_VALUE = 7; + /** + * + * + *
+     * Collector is in error state.
+     * 
+ * + * STATE_ERROR = 8; + */ + public static final int STATE_ERROR_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 STATE_INITIALIZING; + case 2: + return STATE_READY_TO_USE; + case 3: + return STATE_REGISTERED; + case 4: + return STATE_ACTIVE; + case 5: + return STATE_PAUSED; + case 6: + return STATE_DELETING; + case 7: + return STATE_DECOMMISSIONED; + case 8: + return STATE_ERROR; + 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.rapidmigrationassessment.v1.Collector.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.rapidmigrationassessment.v1.Collector.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * name of resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * name of resource.
+   * 
+ * + * 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 CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Collector_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + 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(); + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @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(); + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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; + } + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + @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 DISPLAY_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * User specified name of the Collector.
+   * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * User specified name of the Collector.
+   * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * User specified description of the Collector.
+   * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+   * User specified description of the Collector.
+   * 
+ * + * string description = 6; + * + * @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 SERVICE_ACCOUNT_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+   * Service Account email used to ingest data to this Collector.
+   * 
+ * + * string service_account = 7; + * + * @return The serviceAccount. + */ + @java.lang.Override + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } + } + /** + * + * + *
+   * Service Account email used to ingest data to this Collector.
+   * 
+ * + * string service_account = 7; + * + * @return The bytes for serviceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucket_ = ""; + /** + * + * + *
+   * Output only. Store cloud storage bucket name (which is a guid) created with
+   * this Collector.
+   * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Store cloud storage bucket name (which is a guid) created with
+   * this Collector.
+   * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPECTED_ASSET_COUNT_FIELD_NUMBER = 9; + private long expectedAssetCount_ = 0L; + /** + * + * + *
+   * User specified expected asset count.
+   * 
+ * + * int64 expected_asset_count = 9; + * + * @return The expectedAssetCount. + */ + @java.lang.Override + public long getExpectedAssetCount() { + return expectedAssetCount_; + } + + public static final int STATE_FIELD_NUMBER = 10; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of the Collector.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.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. State of the Collector.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector.State getState() { + com.google.cloud.rapidmigrationassessment.v1.Collector.State result = + com.google.cloud.rapidmigrationassessment.v1.Collector.State.forNumber(state_); + return result == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.State.UNRECOGNIZED + : result; + } + + public static final int CLIENT_VERSION_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object clientVersion_ = ""; + /** + * + * + *
+   * Output only. Client version.
+   * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clientVersion. + */ + @java.lang.Override + public java.lang.String getClientVersion() { + java.lang.Object ref = clientVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Client version.
+   * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clientVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClientVersionBytes() { + java.lang.Object ref = clientVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GUEST_OS_SCAN_FIELD_NUMBER = 12; + private com.google.cloud.rapidmigrationassessment.v1.GuestOsScan guestOsScan_; + /** + * + * + *
+   * Output only. Reference to MC Source Guest Os Scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the guestOsScan field is set. + */ + @java.lang.Override + public boolean hasGuestOsScan() { + return guestOsScan_ != null; + } + /** + * + * + *
+   * Output only. Reference to MC Source Guest Os Scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The guestOsScan. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScan getGuestOsScan() { + return guestOsScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance() + : guestOsScan_; + } + /** + * + * + *
+   * Output only. Reference to MC Source Guest Os Scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder + getGuestOsScanOrBuilder() { + return guestOsScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance() + : guestOsScan_; + } + + public static final int VSPHERE_SCAN_FIELD_NUMBER = 13; + private com.google.cloud.rapidmigrationassessment.v1.VSphereScan vsphereScan_; + /** + * + * + *
+   * Output only. Reference to MC Source vsphere_scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the vsphereScan field is set. + */ + @java.lang.Override + public boolean hasVsphereScan() { + return vsphereScan_ != null; + } + /** + * + * + *
+   * Output only. Reference to MC Source vsphere_scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The vsphereScan. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.VSphereScan getVsphereScan() { + return vsphereScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance() + : vsphereScan_; + } + /** + * + * + *
+   * Output only. Reference to MC Source vsphere_scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder + getVsphereScanOrBuilder() { + return vsphereScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance() + : vsphereScan_; + } + + public static final int COLLECTION_DAYS_FIELD_NUMBER = 14; + private int collectionDays_ = 0; + /** + * + * + *
+   * How many days to collect data.
+   * 
+ * + * int32 collection_days = 14; + * + * @return The collectionDays. + */ + @java.lang.Override + public int getCollectionDays() { + return collectionDays_; + } + + public static final int EULA_URI_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object eulaUri_ = ""; + /** + * + * + *
+   * Uri for EULA (End User License Agreement) from customer.
+   * 
+ * + * string eula_uri = 15; + * + * @return The eulaUri. + */ + @java.lang.Override + public java.lang.String getEulaUri() { + java.lang.Object ref = eulaUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eulaUri_ = s; + return s; + } + } + /** + * + * + *
+   * Uri for EULA (End User License Agreement) from customer.
+   * 
+ * + * string eula_uri = 15; + * + * @return The bytes for eulaUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEulaUriBytes() { + java.lang.Object ref = eulaUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eulaUri_ = 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 (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, serviceAccount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, bucket_); + } + if (expectedAssetCount_ != 0L) { + output.writeInt64(9, expectedAssetCount_); + } + if (state_ + != com.google.cloud.rapidmigrationassessment.v1.Collector.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, clientVersion_); + } + if (guestOsScan_ != null) { + output.writeMessage(12, getGuestOsScan()); + } + if (vsphereScan_ != null) { + output.writeMessage(13, getVsphereScan()); + } + if (collectionDays_ != 0) { + output.writeInt32(14, collectionDays_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eulaUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, eulaUri_); + } + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + 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(4, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, serviceAccount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, bucket_); + } + if (expectedAssetCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, expectedAssetCount_); + } + if (state_ + != com.google.cloud.rapidmigrationassessment.v1.Collector.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, clientVersion_); + } + if (guestOsScan_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getGuestOsScan()); + } + if (vsphereScan_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getVsphereScan()); + } + if (collectionDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(14, collectionDays_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eulaUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, eulaUri_); + } + 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.rapidmigrationassessment.v1.Collector)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.Collector other = + (com.google.cloud.rapidmigrationassessment.v1.Collector) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (!getBucket().equals(other.getBucket())) return false; + if (getExpectedAssetCount() != other.getExpectedAssetCount()) return false; + if (state_ != other.state_) return false; + if (!getClientVersion().equals(other.getClientVersion())) return false; + if (hasGuestOsScan() != other.hasGuestOsScan()) return false; + if (hasGuestOsScan()) { + if (!getGuestOsScan().equals(other.getGuestOsScan())) return false; + } + if (hasVsphereScan() != other.hasVsphereScan()) return false; + if (hasVsphereScan()) { + if (!getVsphereScan().equals(other.getVsphereScan())) return false; + } + if (getCollectionDays() != other.getCollectionDays()) return false; + if (!getEulaUri().equals(other.getEulaUri())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + EXPECTED_ASSET_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getExpectedAssetCount()); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CLIENT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getClientVersion().hashCode(); + if (hasGuestOsScan()) { + hash = (37 * hash) + GUEST_OS_SCAN_FIELD_NUMBER; + hash = (53 * hash) + getGuestOsScan().hashCode(); + } + if (hasVsphereScan()) { + hash = (37 * hash) + VSPHERE_SCAN_FIELD_NUMBER; + hash = (53 * hash) + getVsphereScan().hashCode(); + } + hash = (37 * hash) + COLLECTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getCollectionDays(); + hash = (37 * hash) + EULA_URI_FIELD_NUMBER; + hash = (53 * hash) + getEulaUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector 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.rapidmigrationassessment.v1.Collector parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector 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.rapidmigrationassessment.v1.Collector parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector 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.rapidmigrationassessment.v1.Collector parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector 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.rapidmigrationassessment.v1.Collector parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector 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.rapidmigrationassessment.v1.Collector prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing Collector object.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.Collector} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.Collector) + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Collector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.Collector.class, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder.class); + } + + // Construct using com.google.cloud.rapidmigrationassessment.v1.Collector.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + displayName_ = ""; + description_ = ""; + serviceAccount_ = ""; + bucket_ = ""; + expectedAssetCount_ = 0L; + state_ = 0; + clientVersion_ = ""; + guestOsScan_ = null; + if (guestOsScanBuilder_ != null) { + guestOsScanBuilder_.dispose(); + guestOsScanBuilder_ = null; + } + vsphereScan_ = null; + if (vsphereScanBuilder_ != null) { + vsphereScanBuilder_.dispose(); + vsphereScanBuilder_ = null; + } + collectionDays_ = 0; + eulaUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_Collector_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector build() { + com.google.cloud.rapidmigrationassessment.v1.Collector result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.Collector result = + new com.google.cloud.rapidmigrationassessment.v1.Collector(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.rapidmigrationassessment.v1.Collector result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.serviceAccount_ = serviceAccount_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.bucket_ = bucket_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.expectedAssetCount_ = expectedAssetCount_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.clientVersion_ = clientVersion_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.guestOsScan_ = + guestOsScanBuilder_ == null ? guestOsScan_ : guestOsScanBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.vsphereScan_ = + vsphereScanBuilder_ == null ? vsphereScan_ : vsphereScanBuilder_.build(); + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.collectionDays_ = collectionDays_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.eulaUri_ = eulaUri_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.Collector) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.Collector) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.rapidmigrationassessment.v1.Collector other) { + if (other == com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getExpectedAssetCount() != 0L) { + setExpectedAssetCount(other.getExpectedAssetCount()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getClientVersion().isEmpty()) { + clientVersion_ = other.clientVersion_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasGuestOsScan()) { + mergeGuestOsScan(other.getGuestOsScan()); + } + if (other.hasVsphereScan()) { + mergeVsphereScan(other.getVsphereScan()); + } + if (other.getCollectionDays() != 0) { + setCollectionDays(other.getCollectionDays()); + } + if (!other.getEulaUri().isEmpty()) { + eulaUri_ = other.eulaUri_; + bitField0_ |= 0x00004000; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + serviceAccount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + bucket_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + expectedAssetCount_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 90: + { + clientVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage(getGuestOsScanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 106: + { + input.readMessage(getVsphereScanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 106 + case 112: + { + collectionDays_ = input.readInt32(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 122: + { + eulaUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 + 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_ = ""; + /** + * + * + *
+     * name of resource.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * name of resource.
+     * 
+ * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000002); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Create time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Update time stamp.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + 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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @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(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + 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; + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + @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() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + 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() { + bitField0_ |= 0x00000008; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + 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); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * Labels as key value pairs.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * User specified name of the Collector.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User specified name of the Collector.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User specified name of the Collector.
+     * 
+ * + * string display_name = 5; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * User specified name of the Collector.
+     * 
+ * + * string display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * User specified name of the Collector.
+     * 
+ * + * string display_name = 5; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User specified description of the Collector.
+     * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+     * User specified description of the Collector.
+     * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+     * User specified description of the Collector.
+     * 
+ * + * string description = 6; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * User specified description of the Collector.
+     * 
+ * + * string description = 6; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * User specified description of the Collector.
+     * 
+ * + * string description = 6; + * + * @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; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+     * Service Account email used to ingest data to this Collector.
+     * 
+ * + * string service_account = 7; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Service Account email used to ingest data to this Collector.
+     * 
+ * + * string service_account = 7; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Service Account email used to ingest data to this Collector.
+     * 
+ * + * string service_account = 7; + * + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccount_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Service Account email used to ingest data to this Collector.
+     * 
+ * + * string service_account = 7; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + serviceAccount_ = getDefaultInstance().getServiceAccount(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Service Account email used to ingest data to this Collector.
+     * 
+ * + * string service_account = 7; + * + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAccount_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object bucket_ = ""; + /** + * + * + *
+     * Output only. Store cloud storage bucket name (which is a guid) created with
+     * this Collector.
+     * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Store cloud storage bucket name (which is a guid) created with
+     * this Collector.
+     * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Store cloud storage bucket name (which is a guid) created with
+     * this Collector.
+     * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Store cloud storage bucket name (which is a guid) created with
+     * this Collector.
+     * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + bucket_ = getDefaultInstance().getBucket(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Store cloud storage bucket name (which is a guid) created with
+     * this Collector.
+     * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucket_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private long expectedAssetCount_; + /** + * + * + *
+     * User specified expected asset count.
+     * 
+ * + * int64 expected_asset_count = 9; + * + * @return The expectedAssetCount. + */ + @java.lang.Override + public long getExpectedAssetCount() { + return expectedAssetCount_; + } + /** + * + * + *
+     * User specified expected asset count.
+     * 
+ * + * int64 expected_asset_count = 9; + * + * @param value The expectedAssetCount to set. + * @return This builder for chaining. + */ + public Builder setExpectedAssetCount(long value) { + + expectedAssetCount_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * User specified expected asset count.
+     * 
+ * + * int64 expected_asset_count = 9; + * + * @return This builder for chaining. + */ + public Builder clearExpectedAssetCount() { + bitField0_ = (bitField0_ & ~0x00000100); + expectedAssetCount_ = 0L; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the Collector.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.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. State of the Collector.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.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; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the Collector.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector.State getState() { + com.google.cloud.rapidmigrationassessment.v1.Collector.State result = + com.google.cloud.rapidmigrationassessment.v1.Collector.State.forNumber(state_); + return result == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the Collector.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.rapidmigrationassessment.v1.Collector.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the Collector.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000200); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object clientVersion_ = ""; + /** + * + * + *
+     * Output only. Client version.
+     * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clientVersion. + */ + public java.lang.String getClientVersion() { + java.lang.Object ref = clientVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clientVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Client version.
+     * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clientVersion. + */ + public com.google.protobuf.ByteString getClientVersionBytes() { + java.lang.Object ref = clientVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clientVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Client version.
+     * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The clientVersion to set. + * @return This builder for chaining. + */ + public Builder setClientVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + clientVersion_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Client version.
+     * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearClientVersion() { + clientVersion_ = getDefaultInstance().getClientVersion(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Client version.
+     * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for clientVersion to set. + * @return This builder for chaining. + */ + public Builder setClientVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + clientVersion_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private com.google.cloud.rapidmigrationassessment.v1.GuestOsScan guestOsScan_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder> + guestOsScanBuilder_; + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the guestOsScan field is set. + */ + public boolean hasGuestOsScan() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The guestOsScan. + */ + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScan getGuestOsScan() { + if (guestOsScanBuilder_ == null) { + return guestOsScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance() + : guestOsScan_; + } else { + return guestOsScanBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGuestOsScan(com.google.cloud.rapidmigrationassessment.v1.GuestOsScan value) { + if (guestOsScanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + guestOsScan_ = value; + } else { + guestOsScanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGuestOsScan( + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder builderForValue) { + if (guestOsScanBuilder_ == null) { + guestOsScan_ = builderForValue.build(); + } else { + guestOsScanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeGuestOsScan( + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan value) { + if (guestOsScanBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && guestOsScan_ != null + && guestOsScan_ + != com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance()) { + getGuestOsScanBuilder().mergeFrom(value); + } else { + guestOsScan_ = value; + } + } else { + guestOsScanBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearGuestOsScan() { + bitField0_ = (bitField0_ & ~0x00000800); + guestOsScan_ = null; + if (guestOsScanBuilder_ != null) { + guestOsScanBuilder_.dispose(); + guestOsScanBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder + getGuestOsScanBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getGuestOsScanFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder + getGuestOsScanOrBuilder() { + if (guestOsScanBuilder_ != null) { + return guestOsScanBuilder_.getMessageOrBuilder(); + } else { + return guestOsScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance() + : guestOsScan_; + } + } + /** + * + * + *
+     * Output only. Reference to MC Source Guest Os Scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder> + getGuestOsScanFieldBuilder() { + if (guestOsScanBuilder_ == null) { + guestOsScanBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder>( + getGuestOsScan(), getParentForChildren(), isClean()); + guestOsScan_ = null; + } + return guestOsScanBuilder_; + } + + private com.google.cloud.rapidmigrationassessment.v1.VSphereScan vsphereScan_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.VSphereScan, + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder, + com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder> + vsphereScanBuilder_; + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the vsphereScan field is set. + */ + public boolean hasVsphereScan() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The vsphereScan. + */ + public com.google.cloud.rapidmigrationassessment.v1.VSphereScan getVsphereScan() { + if (vsphereScanBuilder_ == null) { + return vsphereScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance() + : vsphereScan_; + } else { + return vsphereScanBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVsphereScan(com.google.cloud.rapidmigrationassessment.v1.VSphereScan value) { + if (vsphereScanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vsphereScan_ = value; + } else { + vsphereScanBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVsphereScan( + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder builderForValue) { + if (vsphereScanBuilder_ == null) { + vsphereScan_ = builderForValue.build(); + } else { + vsphereScanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeVsphereScan( + com.google.cloud.rapidmigrationassessment.v1.VSphereScan value) { + if (vsphereScanBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && vsphereScan_ != null + && vsphereScan_ + != com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance()) { + getVsphereScanBuilder().mergeFrom(value); + } else { + vsphereScan_ = value; + } + } else { + vsphereScanBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearVsphereScan() { + bitField0_ = (bitField0_ & ~0x00001000); + vsphereScan_ = null; + if (vsphereScanBuilder_ != null) { + vsphereScanBuilder_.dispose(); + vsphereScanBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder + getVsphereScanBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getVsphereScanFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder + getVsphereScanOrBuilder() { + if (vsphereScanBuilder_ != null) { + return vsphereScanBuilder_.getMessageOrBuilder(); + } else { + return vsphereScan_ == null + ? com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance() + : vsphereScan_; + } + } + /** + * + * + *
+     * Output only. Reference to MC Source vsphere_scan.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.VSphereScan, + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder, + com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder> + getVsphereScanFieldBuilder() { + if (vsphereScanBuilder_ == null) { + vsphereScanBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.VSphereScan, + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder, + com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder>( + getVsphereScan(), getParentForChildren(), isClean()); + vsphereScan_ = null; + } + return vsphereScanBuilder_; + } + + private int collectionDays_; + /** + * + * + *
+     * How many days to collect data.
+     * 
+ * + * int32 collection_days = 14; + * + * @return The collectionDays. + */ + @java.lang.Override + public int getCollectionDays() { + return collectionDays_; + } + /** + * + * + *
+     * How many days to collect data.
+     * 
+ * + * int32 collection_days = 14; + * + * @param value The collectionDays to set. + * @return This builder for chaining. + */ + public Builder setCollectionDays(int value) { + + collectionDays_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * How many days to collect data.
+     * 
+ * + * int32 collection_days = 14; + * + * @return This builder for chaining. + */ + public Builder clearCollectionDays() { + bitField0_ = (bitField0_ & ~0x00002000); + collectionDays_ = 0; + onChanged(); + return this; + } + + private java.lang.Object eulaUri_ = ""; + /** + * + * + *
+     * Uri for EULA (End User License Agreement) from customer.
+     * 
+ * + * string eula_uri = 15; + * + * @return The eulaUri. + */ + public java.lang.String getEulaUri() { + java.lang.Object ref = eulaUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eulaUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Uri for EULA (End User License Agreement) from customer.
+     * 
+ * + * string eula_uri = 15; + * + * @return The bytes for eulaUri. + */ + public com.google.protobuf.ByteString getEulaUriBytes() { + java.lang.Object ref = eulaUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eulaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Uri for EULA (End User License Agreement) from customer.
+     * 
+ * + * string eula_uri = 15; + * + * @param value The eulaUri to set. + * @return This builder for chaining. + */ + public Builder setEulaUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + eulaUri_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Uri for EULA (End User License Agreement) from customer.
+     * 
+ * + * string eula_uri = 15; + * + * @return This builder for chaining. + */ + public Builder clearEulaUri() { + eulaUri_ = getDefaultInstance().getEulaUri(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Uri for EULA (End User License Agreement) from customer.
+     * 
+ * + * string eula_uri = 15; + * + * @param value The bytes for eulaUri to set. + * @return This builder for chaining. + */ + public Builder setEulaUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + eulaUri_ = value; + bitField0_ |= 0x00004000; + 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.rapidmigrationassessment.v1.Collector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.Collector) + private static final com.google.cloud.rapidmigrationassessment.v1.Collector DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.Collector(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.Collector getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Collector 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.rapidmigrationassessment.v1.Collector getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorName.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorName.java new file mode 100644 index 000000000000..ea98c8d1ab34 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorName.java @@ -0,0 +1,223 @@ +/* + * 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.rapidmigrationassessment.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CollectorName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_COLLECTOR = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/collectors/{collector}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String collector; + + @Deprecated + protected CollectorName() { + project = null; + location = null; + collector = null; + } + + private CollectorName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + collector = Preconditions.checkNotNull(builder.getCollector()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollector() { + return collector; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CollectorName of(String project, String location, String collector) { + return newBuilder().setProject(project).setLocation(location).setCollector(collector).build(); + } + + public static String format(String project, String location, String collector) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCollector(collector) + .build() + .toString(); + } + + public static CollectorName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_COLLECTOR.validatedMatch( + formattedString, "CollectorName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("collector")); + } + + 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 (CollectorName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_COLLECTOR.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 (collector != null) { + fieldMapBuilder.put("collector", collector); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_COLLECTOR.instantiate( + "project", project, "location", location, "collector", collector); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CollectorName that = ((CollectorName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.collector, that.collector); + } + 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(collector); + return h; + } + + /** Builder for projects/{project}/locations/{location}/collectors/{collector}. */ + public static class Builder { + private String project; + private String location; + private String collector; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCollector() { + return collector; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCollector(String collector) { + this.collector = collector; + return this; + } + + private Builder(CollectorName collectorName) { + this.project = collectorName.project; + this.location = collectorName.location; + this.collector = collectorName.collector; + } + + public CollectorName build() { + return new CollectorName(this); + } + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorOrBuilder.java new file mode 100644 index 000000000000..9b99c408dfcc --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CollectorOrBuilder.java @@ -0,0 +1,473 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface CollectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.Collector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * name of resource.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * name of resource.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels as key value pairs.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * User specified name of the Collector.
+   * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * User specified name of the Collector.
+   * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * User specified description of the Collector.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User specified description of the Collector.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Service Account email used to ingest data to this Collector.
+   * 
+ * + * string service_account = 7; + * + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + * + * + *
+   * Service Account email used to ingest data to this Collector.
+   * 
+ * + * string service_account = 7; + * + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString getServiceAccountBytes(); + + /** + * + * + *
+   * Output only. Store cloud storage bucket name (which is a guid) created with
+   * this Collector.
+   * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Output only. Store cloud storage bucket name (which is a guid) created with
+   * this Collector.
+   * 
+ * + * string bucket = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * User specified expected asset count.
+   * 
+ * + * int64 expected_asset_count = 9; + * + * @return The expectedAssetCount. + */ + long getExpectedAssetCount(); + + /** + * + * + *
+   * Output only. State of the Collector.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the Collector.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector.State state = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.rapidmigrationassessment.v1.Collector.State getState(); + + /** + * + * + *
+   * Output only. Client version.
+   * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The clientVersion. + */ + java.lang.String getClientVersion(); + /** + * + * + *
+   * Output only. Client version.
+   * 
+ * + * string client_version = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for clientVersion. + */ + com.google.protobuf.ByteString getClientVersionBytes(); + + /** + * + * + *
+   * Output only. Reference to MC Source Guest Os Scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the guestOsScan field is set. + */ + boolean hasGuestOsScan(); + /** + * + * + *
+   * Output only. Reference to MC Source Guest Os Scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The guestOsScan. + */ + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan getGuestOsScan(); + /** + * + * + *
+   * Output only. Reference to MC Source Guest Os Scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.GuestOsScan guest_os_scan = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder getGuestOsScanOrBuilder(); + + /** + * + * + *
+   * Output only. Reference to MC Source vsphere_scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the vsphereScan field is set. + */ + boolean hasVsphereScan(); + /** + * + * + *
+   * Output only. Reference to MC Source vsphere_scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The vsphereScan. + */ + com.google.cloud.rapidmigrationassessment.v1.VSphereScan getVsphereScan(); + /** + * + * + *
+   * Output only. Reference to MC Source vsphere_scan.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.VSphereScan vsphere_scan = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder getVsphereScanOrBuilder(); + + /** + * + * + *
+   * How many days to collect data.
+   * 
+ * + * int32 collection_days = 14; + * + * @return The collectionDays. + */ + int getCollectionDays(); + + /** + * + * + *
+   * Uri for EULA (End User License Agreement) from customer.
+   * 
+ * + * string eula_uri = 15; + * + * @return The eulaUri. + */ + java.lang.String getEulaUri(); + /** + * + * + *
+   * Uri for EULA (End User License Agreement) from customer.
+   * 
+ * + * string eula_uri = 15; + * + * @return The bytes for eulaUri. + */ + com.google.protobuf.ByteString getEulaUriBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequest.java new file mode 100644 index 000000000000..f17e3bee247f --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequest.java @@ -0,0 +1,1090 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for creating an AnnotationS.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} + */ +public final class CreateAnnotationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) + CreateAnnotationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAnnotationRequest.newBuilder() to construct. + private CreateAnnotationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAnnotationRequest() { + parent_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAnnotationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.class, + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Name of the parent (project+location).
+   * 
+ * + * + * 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. Name of the parent (project+location).
+   * 
+ * + * + * 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 ANNOTATION_FIELD_NUMBER = 2; + private com.google.cloud.rapidmigrationassessment.v1.Annotation annotation_; + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the annotation field is set. + */ + @java.lang.Override + public boolean hasAnnotation() { + return annotation_ != null; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The annotation. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Annotation getAnnotation() { + return annotation_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance() + : annotation_; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder getAnnotationOrBuilder() { + return annotation_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance() + : annotation_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 (annotation_ != null) { + output.writeMessage(2, getAnnotation()); + } + 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 (annotation_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAnnotation()); + } + 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.rapidmigrationassessment.v1.CreateAnnotationRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest other = + (com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasAnnotation() != other.hasAnnotation()) return false; + if (hasAnnotation()) { + if (!getAnnotation().equals(other.getAnnotation())) 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(); + if (hasAnnotation()) { + hash = (37 * hash) + ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + getAnnotation().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.rapidmigrationassessment.v1.CreateAnnotationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest 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.rapidmigrationassessment.v1.CreateAnnotationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest 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.rapidmigrationassessment.v1.CreateAnnotationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest 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.rapidmigrationassessment.v1.CreateAnnotationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + 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.rapidmigrationassessment.v1.CreateAnnotationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest 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.rapidmigrationassessment.v1.CreateAnnotationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating an AnnotationS.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.class, + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + annotation_ = null; + if (annotationBuilder_ != null) { + annotationBuilder_.dispose(); + annotationBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest build() { + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest result = + new com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.annotation_ = annotationBuilder_ == null ? annotation_ : annotationBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAnnotation()) { + mergeAnnotation(other.getAnnotation()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getAnnotationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the parent (project+location).
+     * 
+ * + * + * 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. Name of the parent (project+location).
+     * 
+ * + * + * 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. Name of the parent (project+location).
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the parent (project+location).
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the parent (project+location).
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.rapidmigrationassessment.v1.Annotation annotation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Annotation, + com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder, + com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder> + annotationBuilder_; + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the annotation field is set. + */ + public boolean hasAnnotation() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The annotation. + */ + public com.google.cloud.rapidmigrationassessment.v1.Annotation getAnnotation() { + if (annotationBuilder_ == null) { + return annotation_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance() + : annotation_; + } else { + return annotationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAnnotation(com.google.cloud.rapidmigrationassessment.v1.Annotation value) { + if (annotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + annotation_ = value; + } else { + annotationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAnnotation( + com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder builderForValue) { + if (annotationBuilder_ == null) { + annotation_ = builderForValue.build(); + } else { + annotationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAnnotation(com.google.cloud.rapidmigrationassessment.v1.Annotation value) { + if (annotationBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && annotation_ != null + && annotation_ + != com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance()) { + getAnnotationBuilder().mergeFrom(value); + } else { + annotation_ = value; + } + } else { + annotationBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAnnotation() { + bitField0_ = (bitField0_ & ~0x00000002); + annotation_ = null; + if (annotationBuilder_ != null) { + annotationBuilder_.dispose(); + annotationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder getAnnotationBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAnnotationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder + getAnnotationOrBuilder() { + if (annotationBuilder_ != null) { + return annotationBuilder_.getMessageOrBuilder(); + } else { + return annotation_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Annotation.getDefaultInstance() + : annotation_; + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Annotation, + com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder, + com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder> + getAnnotationFieldBuilder() { + if (annotationBuilder_ == null) { + annotationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Annotation, + com.google.cloud.rapidmigrationassessment.v1.Annotation.Builder, + com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder>( + getAnnotation(), getParentForChildren(), isClean()); + annotation_ = null; + } + return annotationBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.rapidmigrationassessment.v1.CreateAnnotationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAnnotationRequest 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.rapidmigrationassessment.v1.CreateAnnotationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequestOrBuilder.java new file mode 100644 index 000000000000..2a53773b1f5c --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateAnnotationRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface CreateAnnotationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the parent (project+location).
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the parent (project+location).
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the annotation field is set. + */ + boolean hasAnnotation(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The annotation. + */ + com.google.cloud.rapidmigrationassessment.v1.Annotation getAnnotation(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Annotation annotation = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.rapidmigrationassessment.v1.AnnotationOrBuilder getAnnotationOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequest.java new file mode 100644 index 000000000000..535fd7c674cb --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequest.java @@ -0,0 +1,1271 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for creating a Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} + */ +public final class CreateCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) + CreateCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateCollectorRequest.newBuilder() to construct. + private CreateCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateCollectorRequest() { + parent_ = ""; + collectorId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Name of the parent (project+location).
+   * 
+ * + * + * 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. Name of the parent (project+location).
+   * 
+ * + * + * 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 COLLECTOR_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object collectorId_ = ""; + /** + * + * + *
+   * Required. Id of the requesting object.
+   * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The collectorId. + */ + @java.lang.Override + public java.lang.String getCollectorId() { + java.lang.Object ref = collectorId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectorId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Id of the requesting object.
+   * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for collectorId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCollectorIdBytes() { + java.lang.Object ref = collectorId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLLECTOR_FIELD_NUMBER = 3; + private com.google.cloud.rapidmigrationassessment.v1.Collector collector_; + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the collector field is set. + */ + @java.lang.Override + public boolean hasCollector() { + return collector_ != null; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The collector. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollector() { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorOrBuilder() { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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(collectorId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collectorId_); + } + if (collector_ != null) { + output.writeMessage(3, getCollector()); + } + 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(collectorId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, collectorId_); + } + if (collector_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCollector()); + } + 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.rapidmigrationassessment.v1.CreateCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getCollectorId().equals(other.getCollectorId())) return false; + if (hasCollector() != other.hasCollector()) return false; + if (hasCollector()) { + if (!getCollector().equals(other.getCollector())) 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) + COLLECTOR_ID_FIELD_NUMBER; + hash = (53 * hash) + getCollectorId().hashCode(); + if (hasCollector()) { + hash = (37 * hash) + COLLECTOR_FIELD_NUMBER; + hash = (53 * hash) + getCollector().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.rapidmigrationassessment.v1.CreateCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest 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.rapidmigrationassessment.v1.CreateCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest 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.rapidmigrationassessment.v1.CreateCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest 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.rapidmigrationassessment.v1.CreateCollectorRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + 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.rapidmigrationassessment.v1.CreateCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest 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.rapidmigrationassessment.v1.CreateCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + collectorId_ = ""; + collector_ = null; + if (collectorBuilder_ != null) { + collectorBuilder_.dispose(); + collectorBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.collectorId_ = collectorId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.collector_ = collectorBuilder_ == null ? collector_ : collectorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getCollectorId().isEmpty()) { + collectorId_ = other.collectorId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCollector()) { + mergeCollector(other.getCollector()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + collectorId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCollectorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + 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 int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the parent (project+location).
+     * 
+ * + * + * 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. Name of the parent (project+location).
+     * 
+ * + * + * 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. Name of the parent (project+location).
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the parent (project+location).
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the parent (project+location).
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object collectorId_ = ""; + /** + * + * + *
+     * Required. Id of the requesting object.
+     * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The collectorId. + */ + public java.lang.String getCollectorId() { + java.lang.Object ref = collectorId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + collectorId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Id of the requesting object.
+     * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for collectorId. + */ + public com.google.protobuf.ByteString getCollectorIdBytes() { + java.lang.Object ref = collectorId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + collectorId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Id of the requesting object.
+     * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The collectorId to set. + * @return This builder for chaining. + */ + public Builder setCollectorId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + collectorId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Id of the requesting object.
+     * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCollectorId() { + collectorId_ = getDefaultInstance().getCollectorId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Id of the requesting object.
+     * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for collectorId to set. + * @return This builder for chaining. + */ + public Builder setCollectorIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + collectorId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.rapidmigrationassessment.v1.Collector collector_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder> + collectorBuilder_; + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the collector field is set. + */ + public boolean hasCollector() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The collector. + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollector() { + if (collectorBuilder_ == null) { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } else { + return collectorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCollector(com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + collector_ = value; + } else { + collectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCollector( + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder builderForValue) { + if (collectorBuilder_ == null) { + collector_ = builderForValue.build(); + } else { + collectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCollector(com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && collector_ != null + && collector_ + != com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance()) { + getCollectorBuilder().mergeFrom(value); + } else { + collector_ = value; + } + } else { + collectorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCollector() { + bitField0_ = (bitField0_ & ~0x00000004); + collector_ = null; + if (collectorBuilder_ != null) { + collectorBuilder_.dispose(); + collectorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector.Builder getCollectorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCollectorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorOrBuilder() { + if (collectorBuilder_ != null) { + return collectorBuilder_.getMessageOrBuilder(); + } else { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder> + getCollectorFieldBuilder() { + if (collectorBuilder_ == null) { + collectorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder>( + getCollector(), getParentForChildren(), isClean()); + collector_ = null; + } + return collectorBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests.
+     * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000008; + 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.rapidmigrationassessment.v1.CreateCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateCollectorRequest 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.rapidmigrationassessment.v1.CreateCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..74e41b99ee22 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/CreateCollectorRequestOrBuilder.java @@ -0,0 +1,145 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface CreateCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the parent (project+location).
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the parent (project+location).
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Id of the requesting object.
+   * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The collectorId. + */ + java.lang.String getCollectorId(); + /** + * + * + *
+   * Required. Id of the requesting object.
+   * 
+ * + * string collector_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for collectorId. + */ + com.google.protobuf.ByteString getCollectorIdBytes(); + + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the collector field is set. + */ + boolean hasCollector(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The collector. + */ + com.google.cloud.rapidmigrationassessment.v1.Collector getCollector(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests.
+   * 
+ * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequest.java new file mode 100644 index 000000000000..382330150e36 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequest.java @@ -0,0 +1,883 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for deleting a Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} + */ +public final class DeleteCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) + DeleteCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteCollectorRequest.newBuilder() to construct. + private DeleteCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteCollectorRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.rapidmigrationassessment.v1.DeleteCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) 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.rapidmigrationassessment.v1.DeleteCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest 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.rapidmigrationassessment.v1.DeleteCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest 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.rapidmigrationassessment.v1.DeleteCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest 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.rapidmigrationassessment.v1.DeleteCollectorRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + 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.rapidmigrationassessment.v1.DeleteCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest 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.rapidmigrationassessment.v1.DeleteCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for deleting a Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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.rapidmigrationassessment.v1.DeleteCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCollectorRequest 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.rapidmigrationassessment.v1.DeleteCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..6271ec0d8b54 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/DeleteCollectorRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface DeleteCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequest.java new file mode 100644 index 000000000000..e76e1de042c4 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequest.java @@ -0,0 +1,615 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for getting a specific Annotation
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} + */ +public final class GetAnnotationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) + GetAnnotationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAnnotationRequest.newBuilder() to construct. + private GetAnnotationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAnnotationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAnnotationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.class, + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.rapidmigrationassessment.v1.GetAnnotationRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest other = + (com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) 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.rapidmigrationassessment.v1.GetAnnotationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest 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.rapidmigrationassessment.v1.GetAnnotationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest 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.rapidmigrationassessment.v1.GetAnnotationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest 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.rapidmigrationassessment.v1.GetAnnotationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + 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.rapidmigrationassessment.v1.GetAnnotationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest 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.rapidmigrationassessment.v1.GetAnnotationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a specific Annotation
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.class, + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest build() { + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest result = + new com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.rapidmigrationassessment.v1.GetAnnotationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAnnotationRequest 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.rapidmigrationassessment.v1.GetAnnotationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequestOrBuilder.java new file mode 100644 index 000000000000..c921590e8656 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetAnnotationRequestOrBuilder.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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface GetAnnotationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequest.java new file mode 100644 index 000000000000..093a6fae7f43 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequest.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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for getting a specific Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} + */ +public final class GetCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) + GetCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCollectorRequest.newBuilder() to construct. + private GetCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCollectorRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.rapidmigrationassessment.v1.GetCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) 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.rapidmigrationassessment.v1.GetCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest 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.rapidmigrationassessment.v1.GetCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest 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.rapidmigrationassessment.v1.GetCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest 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.rapidmigrationassessment.v1.GetCollectorRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest 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.rapidmigrationassessment.v1.GetCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest 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.rapidmigrationassessment.v1.GetCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for getting a specific Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.GetCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.Builder.class); + } + + // Construct using com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + 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(); + bitField0_ |= 0x00000001; + 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.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + 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.rapidmigrationassessment.v1.GetCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCollectorRequest 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.rapidmigrationassessment.v1.GetCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..6c2479c679eb --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GetCollectorRequestOrBuilder.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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface GetCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.GetCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScan.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScan.java new file mode 100644 index 000000000000..06f068d070c1 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScan.java @@ -0,0 +1,592 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message describing a MC Source of type Guest OS Scan.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.GuestOsScan} + */ +public final class GuestOsScan extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.GuestOsScan) + GuestOsScanOrBuilder { + private static final long serialVersionUID = 0L; + // Use GuestOsScan.newBuilder() to construct. + private GuestOsScan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GuestOsScan() { + coreSource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GuestOsScan(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.class, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder.class); + } + + public static final int CORE_SOURCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object coreSource_ = ""; + /** + * + * + *
+   * reference to the corresponding Guest OS Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The coreSource. + */ + @java.lang.Override + public java.lang.String getCoreSource() { + java.lang.Object ref = coreSource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + coreSource_ = s; + return s; + } + } + /** + * + * + *
+   * reference to the corresponding Guest OS Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The bytes for coreSource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCoreSourceBytes() { + java.lang.Object ref = coreSource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + coreSource_ = 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(coreSource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, coreSource_); + } + 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(coreSource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, coreSource_); + } + 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.rapidmigrationassessment.v1.GuestOsScan)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan other = + (com.google.cloud.rapidmigrationassessment.v1.GuestOsScan) obj; + + if (!getCoreSource().equals(other.getCoreSource())) 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) + CORE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getCoreSource().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan 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.rapidmigrationassessment.v1.GuestOsScan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan 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.rapidmigrationassessment.v1.GuestOsScan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan 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.rapidmigrationassessment.v1.GuestOsScan parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan 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.rapidmigrationassessment.v1.GuestOsScan parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan 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.rapidmigrationassessment.v1.GuestOsScan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing a MC Source of type Guest OS Scan.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.GuestOsScan} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.GuestOsScan) + com.google.cloud.rapidmigrationassessment.v1.GuestOsScanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.class, + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.Builder.class); + } + + // Construct using com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + coreSource_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_GuestOsScan_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScan getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScan build() { + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.GuestOsScan buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.GuestOsScan result = + new com.google.cloud.rapidmigrationassessment.v1.GuestOsScan(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.rapidmigrationassessment.v1.GuestOsScan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.coreSource_ = coreSource_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.GuestOsScan) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.GuestOsScan) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.rapidmigrationassessment.v1.GuestOsScan other) { + if (other == com.google.cloud.rapidmigrationassessment.v1.GuestOsScan.getDefaultInstance()) + return this; + if (!other.getCoreSource().isEmpty()) { + coreSource_ = other.coreSource_; + bitField0_ |= 0x00000001; + 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: + { + coreSource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object coreSource_ = ""; + /** + * + * + *
+     * reference to the corresponding Guest OS Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @return The coreSource. + */ + public java.lang.String getCoreSource() { + java.lang.Object ref = coreSource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + coreSource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * reference to the corresponding Guest OS Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @return The bytes for coreSource. + */ + public com.google.protobuf.ByteString getCoreSourceBytes() { + java.lang.Object ref = coreSource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + coreSource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * reference to the corresponding Guest OS Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @param value The coreSource to set. + * @return This builder for chaining. + */ + public Builder setCoreSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + coreSource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * reference to the corresponding Guest OS Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @return This builder for chaining. + */ + public Builder clearCoreSource() { + coreSource_ = getDefaultInstance().getCoreSource(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * reference to the corresponding Guest OS Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @param value The bytes for coreSource to set. + * @return This builder for chaining. + */ + public Builder setCoreSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + coreSource_ = value; + bitField0_ |= 0x00000001; + 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.rapidmigrationassessment.v1.GuestOsScan) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.GuestOsScan) + private static final com.google.cloud.rapidmigrationassessment.v1.GuestOsScan DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.GuestOsScan(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.GuestOsScan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GuestOsScan 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.rapidmigrationassessment.v1.GuestOsScan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScanOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScanOrBuilder.java new file mode 100644 index 000000000000..b30cc140fdc4 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/GuestOsScanOrBuilder.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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface GuestOsScanOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.GuestOsScan) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * reference to the corresponding Guest OS Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The coreSource. + */ + java.lang.String getCoreSource(); + /** + * + * + *
+   * reference to the corresponding Guest OS Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The bytes for coreSource. + */ + com.google.protobuf.ByteString getCoreSourceBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequest.java new file mode 100644 index 000000000000..da60b8cf34f2 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequest.java @@ -0,0 +1,1260 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for requesting list of Collectors.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} + */ +public final class ListCollectorsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) + ListCollectorsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCollectorsRequest.newBuilder() to construct. + private ListCollectorsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCollectorsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCollectorsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.class, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListCollectorsRequest.
+   * 
+ * + * + * 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. Parent value for ListCollectorsRequest.
+   * 
+ * + * + * 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_ = 0; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Filtering results.
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+   * Filtering results.
+   * 
+ * + * string filter = 4; + * + * @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 = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Hint for how to order the results.
+   * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+   * Hint for how to order the results.
+   * 
+ * + * string order_by = 5; + * + * @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, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, 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(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, 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.rapidmigrationassessment.v1.ListCollectorsRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest other = + (com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) 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.rapidmigrationassessment.v1.ListCollectorsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest 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.rapidmigrationassessment.v1.ListCollectorsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest 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.rapidmigrationassessment.v1.ListCollectorsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest 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.rapidmigrationassessment.v1.ListCollectorsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + 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.rapidmigrationassessment.v1.ListCollectorsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest 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.rapidmigrationassessment.v1.ListCollectorsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for requesting list of Collectors.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.class, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest build() { + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest result = + new com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListCollectorsRequest.
+     * 
+ * + * + * 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. Parent value for ListCollectorsRequest.
+     * 
+ * + * + * 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. Parent value for ListCollectorsRequest.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListCollectorsRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListCollectorsRequest.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filtering results.
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * Filtering results.
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * Filtering results.
+     * 
+ * + * string filter = 4; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Filtering results.
+     * 
+ * + * string filter = 4; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Hint for how to order the results.
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results.
+     * 
+ * + * string order_by = 5; + * + * @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; + } + } + /** + * + * + *
+     * Hint for how to order the results.
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Hint for how to order the results.
+     * 
+ * + * string order_by = 5; + * + * @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; + bitField0_ |= 0x00000010; + 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.rapidmigrationassessment.v1.ListCollectorsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCollectorsRequest 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.rapidmigrationassessment.v1.ListCollectorsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequestOrBuilder.java new file mode 100644 index 000000000000..0b2dc1c0978c --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface ListCollectorsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListCollectorsRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListCollectorsRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filtering results.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filtering results.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Hint for how to order the results.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Hint for how to order the results.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponse.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponse.java new file mode 100644 index 000000000000..60a5b76e16ff --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponse.java @@ -0,0 +1,1387 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for response to listing Collectors.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} + */ +public final class ListCollectorsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) + ListCollectorsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCollectorsResponse.newBuilder() to construct. + private ListCollectorsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCollectorsResponse() { + collectors_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCollectorsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.class, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.Builder.class); + } + + public static final int COLLECTORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List collectors_; + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + @java.lang.Override + public java.util.List + getCollectorsList() { + return collectors_; + } + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + @java.lang.Override + public java.util.List + getCollectorsOrBuilderList() { + return collectors_; + } + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + @java.lang.Override + public int getCollectorsCount() { + return collectors_.size(); + } + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollectors(int index) { + return collectors_.get(index); + } + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorsOrBuilder( + int index) { + return collectors_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * 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 < collectors_.size(); i++) { + output.writeMessage(1, collectors_.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 < collectors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, collectors_.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.rapidmigrationassessment.v1.ListCollectorsResponse)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse other = + (com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) obj; + + if (!getCollectorsList().equals(other.getCollectorsList())) 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 (getCollectorsCount() > 0) { + hash = (37 * hash) + COLLECTORS_FIELD_NUMBER; + hash = (53 * hash) + getCollectorsList().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.rapidmigrationassessment.v1.ListCollectorsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse 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.rapidmigrationassessment.v1.ListCollectorsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse 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.rapidmigrationassessment.v1.ListCollectorsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse 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.rapidmigrationassessment.v1.ListCollectorsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + 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.rapidmigrationassessment.v1.ListCollectorsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse 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.rapidmigrationassessment.v1.ListCollectorsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing Collectors.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.class, + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (collectorsBuilder_ == null) { + collectors_ = java.util.Collections.emptyList(); + } else { + collectors_ = null; + collectorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse build() { + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse result = + new com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse result) { + if (collectorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + collectors_ = java.util.Collections.unmodifiableList(collectors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.collectors_ = collectors_; + } else { + result.collectors_ = collectorsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + .getDefaultInstance()) return this; + if (collectorsBuilder_ == null) { + if (!other.collectors_.isEmpty()) { + if (collectors_.isEmpty()) { + collectors_ = other.collectors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCollectorsIsMutable(); + collectors_.addAll(other.collectors_); + } + onChanged(); + } + } else { + if (!other.collectors_.isEmpty()) { + if (collectorsBuilder_.isEmpty()) { + collectorsBuilder_.dispose(); + collectorsBuilder_ = null; + collectors_ = other.collectors_; + bitField0_ = (bitField0_ & ~0x00000001); + collectorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCollectorsFieldBuilder() + : null; + } else { + collectorsBuilder_.addAllMessages(other.collectors_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } 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.rapidmigrationassessment.v1.Collector m = + input.readMessage( + com.google.cloud.rapidmigrationassessment.v1.Collector.parser(), + extensionRegistry); + if (collectorsBuilder_ == null) { + ensureCollectorsIsMutable(); + collectors_.add(m); + } else { + collectorsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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 collectors_ = + java.util.Collections.emptyList(); + + private void ensureCollectorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + collectors_ = + new java.util.ArrayList( + collectors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder> + collectorsBuilder_; + + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public java.util.List + getCollectorsList() { + if (collectorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(collectors_); + } else { + return collectorsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public int getCollectorsCount() { + if (collectorsBuilder_ == null) { + return collectors_.size(); + } else { + return collectorsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollectors(int index) { + if (collectorsBuilder_ == null) { + return collectors_.get(index); + } else { + return collectorsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder setCollectors( + int index, com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectorsIsMutable(); + collectors_.set(index, value); + onChanged(); + } else { + collectorsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder setCollectors( + int index, com.google.cloud.rapidmigrationassessment.v1.Collector.Builder builderForValue) { + if (collectorsBuilder_ == null) { + ensureCollectorsIsMutable(); + collectors_.set(index, builderForValue.build()); + onChanged(); + } else { + collectorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder addCollectors(com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectorsIsMutable(); + collectors_.add(value); + onChanged(); + } else { + collectorsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder addCollectors( + int index, com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCollectorsIsMutable(); + collectors_.add(index, value); + onChanged(); + } else { + collectorsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder addCollectors( + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder builderForValue) { + if (collectorsBuilder_ == null) { + ensureCollectorsIsMutable(); + collectors_.add(builderForValue.build()); + onChanged(); + } else { + collectorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder addCollectors( + int index, com.google.cloud.rapidmigrationassessment.v1.Collector.Builder builderForValue) { + if (collectorsBuilder_ == null) { + ensureCollectorsIsMutable(); + collectors_.add(index, builderForValue.build()); + onChanged(); + } else { + collectorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder addAllCollectors( + java.lang.Iterable + values) { + if (collectorsBuilder_ == null) { + ensureCollectorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, collectors_); + onChanged(); + } else { + collectorsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder clearCollectors() { + if (collectorsBuilder_ == null) { + collectors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + collectorsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public Builder removeCollectors(int index) { + if (collectorsBuilder_ == null) { + ensureCollectorsIsMutable(); + collectors_.remove(index); + onChanged(); + } else { + collectorsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector.Builder getCollectorsBuilder( + int index) { + return getCollectorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorsOrBuilder( + int index) { + if (collectorsBuilder_ == null) { + return collectors_.get(index); + } else { + return collectorsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public java.util.List + getCollectorsOrBuilderList() { + if (collectorsBuilder_ != null) { + return collectorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(collectors_); + } + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector.Builder addCollectorsBuilder() { + return getCollectorsFieldBuilder() + .addBuilder(com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector.Builder addCollectorsBuilder( + int index) { + return getCollectorsFieldBuilder() + .addBuilder( + index, com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Collectors.
+     * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + public java.util.List + getCollectorsBuilderList() { + return getCollectorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder> + getCollectorsFieldBuilder() { + if (collectorsBuilder_ == null) { + collectorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder>( + collectors_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + collectors_ = null; + } + return collectorsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + 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); + } + /** + * + * + *
+     * 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); + bitField0_ |= 0x00000004; + 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); + bitField0_ |= 0x00000004; + 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_); + bitField0_ |= 0x00000004; + 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.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + 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); + bitField0_ |= 0x00000004; + 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.rapidmigrationassessment.v1.ListCollectorsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) + private static final com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCollectorsResponse 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.rapidmigrationassessment.v1.ListCollectorsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponseOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponseOrBuilder.java new file mode 100644 index 000000000000..134a4c398bbe --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ListCollectorsResponseOrBuilder.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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface ListCollectorsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + java.util.List getCollectorsList(); + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + com.google.cloud.rapidmigrationassessment.v1.Collector getCollectors(int index); + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + int getCollectorsCount(); + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + java.util.List + getCollectorsOrBuilderList(); + /** + * + * + *
+   * The list of Collectors.
+   * 
+ * + * repeated .google.cloud.rapidmigrationassessment.v1.Collector collectors = 1; + */ + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/LocationName.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/LocationName.java new file mode 100644 index 000000000000..a6e3796a797b --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.rapidmigrationassessment.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadata.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadata.java new file mode 100644 index 000000000000..a0c28d45c63b --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadata.java @@ -0,0 +1,1802 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.class, + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + 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(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + 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.rapidmigrationassessment.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata other = + (com.google.cloud.rapidmigrationassessment.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) 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_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + 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.rapidmigrationassessment.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.OperationMetadata) + com.google.cloud.rapidmigrationassessment.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.class, + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.OperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.OperationMetadata build() { + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.OperationMetadata buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata result = + new com.google.cloud.rapidmigrationassessment.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.rapidmigrationassessment.v1.OperationMetadata other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + 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); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + 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 int bitField0_; + + 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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000040; + 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.rapidmigrationassessment.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.OperationMetadata) + private static final com.google.cloud.rapidmigrationassessment.v1.OperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.OperationMetadata(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.OperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + 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.rapidmigrationassessment.v1.OperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadataOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..3eb9ec28c78a --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequest.java new file mode 100644 index 000000000000..fff903b531ec --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequest.java @@ -0,0 +1,883 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for pausing a Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} + */ +public final class PauseCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) + PauseCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PauseCollectorRequest.newBuilder() to construct. + private PauseCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PauseCollectorRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PauseCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.rapidmigrationassessment.v1.PauseCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) 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.rapidmigrationassessment.v1.PauseCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest 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.rapidmigrationassessment.v1.PauseCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest 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.rapidmigrationassessment.v1.PauseCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest 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.rapidmigrationassessment.v1.PauseCollectorRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + 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.rapidmigrationassessment.v1.PauseCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest 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.rapidmigrationassessment.v1.PauseCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for pausing a Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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.rapidmigrationassessment.v1.PauseCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PauseCollectorRequest 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.rapidmigrationassessment.v1.PauseCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..244c14c5572b --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/PauseCollectorRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface PauseCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentProto.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentProto.java new file mode 100644 index 000000000000..dba6391c21e6 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RapidMigrationAssessmentProto.java @@ -0,0 +1,350 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public final class RapidMigrationAssessmentProto { + private RapidMigrationAssessmentProto() {} + + 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_rapidmigrationassessment_v1_CreateAnnotationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nGgoogle/cloud/rapidmigrationassessment/" + + "v1/rapidmigrationassessment.proto\022(googl" + + "e.cloud.rapidmigrationassessment.v1\032\034goo" + + "gle/api/annotations.proto\032\027google/api/cl" + + "ient.proto\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032;google/c" + + "loud/rapidmigrationassessment/v1/api_ent" + + "ities.proto\032#google/longrunning/operatio" + + "ns.proto\032 google/protobuf/field_mask.pro" + + "to\032\037google/protobuf/timestamp.proto\"\277\001\n\027" + + "CreateAnnotationRequest\022:\n\006parent\030\001 \001(\tB" + + "*\342A\001\002\372A#\n!locations.googleapis.com/Locat" + + "ion\022N\n\nannotation\030\002 \001(\01324.google.cloud.r" + + "apidmigrationassessment.v1.AnnotationB\004\342" + + "A\001\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\"a\n\024GetAnno" + + "tationRequest\022I\n\004name\030\001 \001(\tB;\342A\001\002\372A4\n2ra" + + "pidmigrationassessment.googleapis.com/An" + + "notation\"\330\001\n\026CreateCollectorRequest\022:\n\006p" + + "arent\030\001 \001(\tB*\342A\001\002\372A#\n!locations.googleap" + + "is.com/Location\022\032\n\014collector_id\030\002 \001(\tB\004\342" + + "A\001\002\022L\n\tcollector\030\003 \001(\01323.google.cloud.ra" + + "pidmigrationassessment.v1.CollectorB\004\342A\001" + + "\002\022\030\n\nrequest_id\030\004 \001(\tB\004\342A\001\001\"\234\001\n\025ListColl" + + "ectorsRequest\022:\n\006parent\030\001 \001(\tB*\342A\001\002\372A#\n!" + + "locations.googleapis.com/Location\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\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"\217\001\n\026ListColle" + + "ctorsResponse\022G\n\ncollectors\030\001 \003(\01323.goog" + + "le.cloud.rapidmigrationassessment.v1.Col" + + "lector\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unrea" + + "chable\030\003 \003(\t\"_\n\023GetCollectorRequest\022H\n\004n" + + "ame\030\001 \001(\tB:\342A\001\002\372A3\n1rapidmigrationassess" + + "ment.googleapis.com/Collector\"|\n\026DeleteC" + + "ollectorRequest\022H\n\004name\030\001 \001(\tB:\342A\001\002\372A3\n1" + + "rapidmigrationassessment.googleapis.com/" + + "Collector\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\"\267\001\n\026" + + "UpdateCollectorRequest\0225\n\013update_mask\030\001 " + + "\001(\0132\032.google.protobuf.FieldMaskB\004\342A\001\002\022L\n" + + "\tcollector\030\002 \001(\01323.google.cloud.rapidmig" + + "rationassessment.v1.CollectorB\004\342A\001\002\022\030\n\nr" + + "equest_id\030\003 \001(\tB\004\342A\001\001\"|\n\026ResumeCollector" + + "Request\022H\n\004name\030\001 \001(\tB:\342A\001\002\372A3\n1rapidmig" + + "rationassessment.googleapis.com/Collecto" + + "r\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\"~\n\030RegisterC" + + "ollectorRequest\022H\n\004name\030\001 \001(\tB:\342A\001\002\372A3\n1" + + "rapidmigrationassessment.googleapis.com/" + + "Collector\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001\"{\n\025P" + + "auseCollectorRequest\022H\n\004name\030\001 \001(\tB:\342A\001\002" + + "\372A3\n1rapidmigrationassessment.googleapis" + + ".com/Collector\022\030\n\nrequest_id\030\002 \001(\tB\004\342A\001\001" + + "\"\207\002\n\021OperationMetadata\0225\n\013create_time\030\001 " + + "\001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0222\n" + + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timest" + + "ampB\004\342A\001\003\022\024\n\006target\030\003 \001(\tB\004\342A\001\003\022\022\n\004verb\030" + + "\004 \001(\tB\004\342A\001\003\022\034\n\016status_message\030\005 \001(\tB\004\342A\001" + + "\003\022$\n\026requested_cancellation\030\006 \001(\010B\004\342A\001\003\022" + + "\031\n\013api_version\030\007 \001(\tB\004\342A\001\0032\341\022\n\030RapidMigr" + + "ationAssessment\022\367\001\n\017CreateCollector\022@.go" + + "ogle.cloud.rapidmigrationassessment.v1.C" + + "reateCollectorRequest\032\035.google.longrunni" + + "ng.Operation\"\202\001\312A\036\n\tCollector\022\021Operation" + + "Metadata\332A\035parent,collector,collector_id" + + "\202\323\344\223\002;\"./v1/{parent=projects/*/locations" + + "/*}/collectors:\tcollector\022\231\002\n\020CreateAnno" + + "tation\022A.google.cloud.rapidmigrationasse" + + "ssment.v1.CreateAnnotationRequest\032\035.goog" + + "le.longrunning.Operation\"\242\001\312AH\n3google.c" + + "loud.rapidmigrationassessment.v1.Annotat" + + "ion\022\021OperationMetadata\332A\021parent,annotati" + + "on\202\323\344\223\002=\"//v1/{parent=projects/*/locatio" + + "ns/*}/annotations:\nannotation\022\305\001\n\rGetAnn" + + "otation\022>.google.cloud.rapidmigrationass" + + "essment.v1.GetAnnotationRequest\0324.google" + + ".cloud.rapidmigrationassessment.v1.Annot" + + "ation\">\332A\004name\202\323\344\223\0021\022//v1/{name=projects" + + "/*/locations/*/annotations/*}\022\324\001\n\016ListCo" + + "llectors\022?.google.cloud.rapidmigrationas" + + "sessment.v1.ListCollectorsRequest\032@.goog" + + "le.cloud.rapidmigrationassessment.v1.Lis" + + "tCollectorsResponse\"?\332A\006parent\202\323\344\223\0020\022./v" + + "1/{parent=projects/*/locations/*}/collec" + + "tors\022\301\001\n\014GetCollector\022=.google.cloud.rap" + + "idmigrationassessment.v1.GetCollectorReq" + + "uest\0323.google.cloud.rapidmigrationassess" + + "ment.v1.Collector\"=\332A\004name\202\323\344\223\0020\022./v1/{n" + + "ame=projects/*/locations/*/collectors/*}" + + "\022\371\001\n\017UpdateCollector\022@.google.cloud.rapi" + + "dmigrationassessment.v1.UpdateCollectorR" + + "equest\032\035.google.longrunning.Operation\"\204\001" + + "\312A\036\n\tCollector\022\021OperationMetadata\332A\025coll" + + "ector,update_mask\202\323\344\223\002E28/v1/{collector." + + "name=projects/*/locations/*/collectors/*" + + "}:\tcollector\022\322\001\n\017DeleteCollector\022@.googl" + + "e.cloud.rapidmigrationassessment.v1.Dele" + + "teCollectorRequest\032\035.google.longrunning." + + "Operation\"^\312A\036\n\tCollector\022\021OperationMeta" + + "data\332A\004name\202\323\344\223\0020*./v1/{name=projects/*/" + + "locations/*/collectors/*}\022\334\001\n\017ResumeColl" + + "ector\022@.google.cloud.rapidmigrationasses" + + "sment.v1.ResumeCollectorRequest\032\035.google" + + ".longrunning.Operation\"h\312A\036\n\tCollector\022\021" + + "OperationMetadata\332A\004name\202\323\344\223\002:\"5/v1/{nam" + + "e=projects/*/locations/*/collectors/*}:r" + + "esume:\001*\022\342\001\n\021RegisterCollector\022B.google." + + "cloud.rapidmigrationassessment.v1.Regist" + + "erCollectorRequest\032\035.google.longrunning." + + "Operation\"j\312A\036\n\tCollector\022\021OperationMeta" + + "data\332A\004name\202\323\344\223\002<\"7/v1/{name=projects/*/" + + "locations/*/collectors/*}:register:\001*\022\331\001" + + "\n\016PauseCollector\022?.google.cloud.rapidmig" + + "rationassessment.v1.PauseCollectorReques" + + "t\032\035.google.longrunning.Operation\"g\312A\036\n\tC" + + "ollector\022\021OperationMetadata\332A\004name\202\323\344\223\0029" + + "\"4/v1/{name=projects/*/locations/*/colle" + + "ctors/*}:pause:\001*\032[\312A\'rapidmigrationasse" + + "ssment.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformB\275\002\n,com.g" + + "oogle.cloud.rapidmigrationassessment.v1B" + + "\035RapidMigrationAssessmentProtoP\001Zhcloud." + + "google.com/go/rapidmigrationassessment/a" + + "piv1/rapidmigrationassessmentpb;rapidmig" + + "rationassessmentpb\252\002(Google.Cloud.RapidM" + + "igrationAssessment.V1\312\002(Google\\Cloud\\Rap" + + "idMigrationAssessment\\V1\352\002+Google::Cloud" + + "::RapidMigrationAssessment::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_CreateAnnotationRequest_descriptor, + new java.lang.String[] { + "Parent", "Annotation", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_GetAnnotationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_CreateCollectorRequest_descriptor, + new java.lang.String[] { + "Parent", "CollectorId", "Collector", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_ListCollectorsResponse_descriptor, + new java.lang.String[] { + "Collectors", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_GetCollectorRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_DeleteCollectorRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Collector", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_PauseCollectorRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_rapidmigrationassessment_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequest.java new file mode 100644 index 000000000000..9c2555bff2e0 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequest.java @@ -0,0 +1,883 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for registering a Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} + */ +public final class RegisterCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) + RegisterCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RegisterCollectorRequest.newBuilder() to construct. + private RegisterCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RegisterCollectorRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RegisterCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.rapidmigrationassessment.v1.RegisterCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) 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.rapidmigrationassessment.v1.RegisterCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest 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.rapidmigrationassessment.v1.RegisterCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest 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.rapidmigrationassessment.v1.RegisterCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest 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.rapidmigrationassessment.v1.RegisterCollectorRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + 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.rapidmigrationassessment.v1.RegisterCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest 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.rapidmigrationassessment.v1.RegisterCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for registering a Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_RegisterCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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.rapidmigrationassessment.v1.RegisterCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RegisterCollectorRequest 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.rapidmigrationassessment.v1.RegisterCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..a2e5b7210f40 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/RegisterCollectorRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface RegisterCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequest.java new file mode 100644 index 000000000000..c28aeb4c25c6 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequest.java @@ -0,0 +1,883 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for resuming a Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} + */ +public final class ResumeCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) + ResumeCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResumeCollectorRequest.newBuilder() to construct. + private ResumeCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResumeCollectorRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResumeCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.rapidmigrationassessment.v1.ResumeCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) 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.rapidmigrationassessment.v1.ResumeCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest 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.rapidmigrationassessment.v1.ResumeCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest 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.rapidmigrationassessment.v1.ResumeCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest 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.rapidmigrationassessment.v1.ResumeCollectorRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + 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.rapidmigrationassessment.v1.ResumeCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest 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.rapidmigrationassessment.v1.ResumeCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for resuming a Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_ResumeCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + 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(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + 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. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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.rapidmigrationassessment.v1.ResumeCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResumeCollectorRequest 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.rapidmigrationassessment.v1.ResumeCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..37403a56f034 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/ResumeCollectorRequestOrBuilder.java @@ -0,0 +1,103 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface ResumeCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequest.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequest.java new file mode 100644 index 000000000000..ed11efc80327 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequest.java @@ -0,0 +1,1297 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message for updating a Collector.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} + */ +public final class UpdateCollectorRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) + UpdateCollectorRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateCollectorRequest.newBuilder() to construct. + private UpdateCollectorRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCollectorRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCollectorRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Collector resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .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. Field mask is used to specify the fields to be overwritten in the
+   * Collector resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .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. Field mask is used to specify the fields to be overwritten in the
+   * Collector resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int COLLECTOR_FIELD_NUMBER = 2; + private com.google.cloud.rapidmigrationassessment.v1.Collector collector_; + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the collector field is set. + */ + @java.lang.Override + public boolean hasCollector() { + return collector_ != null; + } + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The collector. + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollector() { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorOrBuilder() { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (collector_ != null) { + output.writeMessage(2, getCollector()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + 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 (collector_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCollector()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, 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.rapidmigrationassessment.v1.UpdateCollectorRequest)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest other = + (com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasCollector() != other.hasCollector()) return false; + if (hasCollector()) { + if (!getCollector().equals(other.getCollector())) 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(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasCollector()) { + hash = (37 * hash) + COLLECTOR_FIELD_NUMBER; + hash = (53 * hash) + getCollector().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.rapidmigrationassessment.v1.UpdateCollectorRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest 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.rapidmigrationassessment.v1.UpdateCollectorRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest 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.rapidmigrationassessment.v1.UpdateCollectorRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest 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.rapidmigrationassessment.v1.UpdateCollectorRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + 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.rapidmigrationassessment.v1.UpdateCollectorRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest 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.rapidmigrationassessment.v1.UpdateCollectorRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a Collector.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.class, + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.Builder.class); + } + + // Construct using + // com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + collector_ = null; + if (collectorBuilder_ != null) { + collectorBuilder_.dispose(); + collectorBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentProto + .internal_static_google_cloud_rapidmigrationassessment_v1_UpdateCollectorRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest build() { + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest result = + new com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.collector_ = collectorBuilder_ == null ? collector_ : collectorBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) { + return mergeFrom( + (com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest other) { + if (other + == com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + .getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasCollector()) { + mergeCollector(other.getCollector()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + 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(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCollectorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + 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 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. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .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. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .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; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .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(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .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. Field mask is used to specify the fields to be overwritten in the
+     * Collector resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .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.rapidmigrationassessment.v1.Collector collector_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder> + collectorBuilder_; + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the collector field is set. + */ + public boolean hasCollector() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The collector. + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector getCollector() { + if (collectorBuilder_ == null) { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } else { + return collectorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCollector(com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + collector_ = value; + } else { + collectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCollector( + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder builderForValue) { + if (collectorBuilder_ == null) { + collector_ = builderForValue.build(); + } else { + collectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCollector(com.google.cloud.rapidmigrationassessment.v1.Collector value) { + if (collectorBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && collector_ != null + && collector_ + != com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance()) { + getCollectorBuilder().mergeFrom(value); + } else { + collector_ = value; + } + } else { + collectorBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCollector() { + bitField0_ = (bitField0_ & ~0x00000002); + collector_ = null; + if (collectorBuilder_ != null) { + collectorBuilder_.dispose(); + collectorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.Collector.Builder getCollectorBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCollectorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorOrBuilder() { + if (collectorBuilder_ != null) { + return collectorBuilder_.getMessageOrBuilder(); + } else { + return collector_ == null + ? com.google.cloud.rapidmigrationassessment.v1.Collector.getDefaultInstance() + : collector_; + } + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder> + getCollectorFieldBuilder() { + if (collectorBuilder_ == null) { + collectorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.rapidmigrationassessment.v1.Collector, + com.google.cloud.rapidmigrationassessment.v1.Collector.Builder, + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder>( + getCollector(), getParentForChildren(), isClean()); + collector_ = null; + } + return collectorBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and
+     * the request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.rapidmigrationassessment.v1.UpdateCollectorRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) + private static final com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCollectorRequest 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.rapidmigrationassessment.v1.UpdateCollectorRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequestOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequestOrBuilder.java new file mode 100644 index 000000000000..91d95fa28ae6 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/UpdateCollectorRequestOrBuilder.java @@ -0,0 +1,165 @@ +/* + * 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/rapidmigrationassessment/v1/rapidmigrationassessment.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface UpdateCollectorRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Collector resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Collector resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Collector resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the collector field is set. + */ + boolean hasCollector(); + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The collector. + */ + com.google.cloud.rapidmigrationassessment.v1.Collector getCollector(); + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.rapidmigrationassessment.v1.Collector collector = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.rapidmigrationassessment.v1.CollectorOrBuilder getCollectorOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and
+   * the request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScan.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScan.java new file mode 100644 index 000000000000..1273694196bb --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScan.java @@ -0,0 +1,592 @@ +/* + * 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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +/** + * + * + *
+ * Message describing a MC Source of type VSphere Scan.
+ * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.VSphereScan} + */ +public final class VSphereScan extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.rapidmigrationassessment.v1.VSphereScan) + VSphereScanOrBuilder { + private static final long serialVersionUID = 0L; + // Use VSphereScan.newBuilder() to construct. + private VSphereScan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VSphereScan() { + coreSource_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VSphereScan(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.class, + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder.class); + } + + public static final int CORE_SOURCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object coreSource_ = ""; + /** + * + * + *
+   * reference to the corresponding VSphere Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The coreSource. + */ + @java.lang.Override + public java.lang.String getCoreSource() { + java.lang.Object ref = coreSource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + coreSource_ = s; + return s; + } + } + /** + * + * + *
+   * reference to the corresponding VSphere Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The bytes for coreSource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCoreSourceBytes() { + java.lang.Object ref = coreSource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + coreSource_ = 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(coreSource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, coreSource_); + } + 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(coreSource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, coreSource_); + } + 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.rapidmigrationassessment.v1.VSphereScan)) { + return super.equals(obj); + } + com.google.cloud.rapidmigrationassessment.v1.VSphereScan other = + (com.google.cloud.rapidmigrationassessment.v1.VSphereScan) obj; + + if (!getCoreSource().equals(other.getCoreSource())) 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) + CORE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getCoreSource().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan 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.rapidmigrationassessment.v1.VSphereScan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan 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.rapidmigrationassessment.v1.VSphereScan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan 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.rapidmigrationassessment.v1.VSphereScan parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan 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.rapidmigrationassessment.v1.VSphereScan parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan 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.rapidmigrationassessment.v1.VSphereScan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message describing a MC Source of type VSphere Scan.
+   * 
+ * + * Protobuf type {@code google.cloud.rapidmigrationassessment.v1.VSphereScan} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.rapidmigrationassessment.v1.VSphereScan) + com.google.cloud.rapidmigrationassessment.v1.VSphereScanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.class, + com.google.cloud.rapidmigrationassessment.v1.VSphereScan.Builder.class); + } + + // Construct using com.google.cloud.rapidmigrationassessment.v1.VSphereScan.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + coreSource_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.rapidmigrationassessment.v1.ApiEntitiesProto + .internal_static_google_cloud_rapidmigrationassessment_v1_VSphereScan_descriptor; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.VSphereScan getDefaultInstanceForType() { + return com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.VSphereScan build() { + com.google.cloud.rapidmigrationassessment.v1.VSphereScan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.rapidmigrationassessment.v1.VSphereScan buildPartial() { + com.google.cloud.rapidmigrationassessment.v1.VSphereScan result = + new com.google.cloud.rapidmigrationassessment.v1.VSphereScan(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.rapidmigrationassessment.v1.VSphereScan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.coreSource_ = coreSource_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.rapidmigrationassessment.v1.VSphereScan) { + return mergeFrom((com.google.cloud.rapidmigrationassessment.v1.VSphereScan) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.rapidmigrationassessment.v1.VSphereScan other) { + if (other == com.google.cloud.rapidmigrationassessment.v1.VSphereScan.getDefaultInstance()) + return this; + if (!other.getCoreSource().isEmpty()) { + coreSource_ = other.coreSource_; + bitField0_ |= 0x00000001; + 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: + { + coreSource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + 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.lang.Object coreSource_ = ""; + /** + * + * + *
+     * reference to the corresponding VSphere Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @return The coreSource. + */ + public java.lang.String getCoreSource() { + java.lang.Object ref = coreSource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + coreSource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * reference to the corresponding VSphere Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @return The bytes for coreSource. + */ + public com.google.protobuf.ByteString getCoreSourceBytes() { + java.lang.Object ref = coreSource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + coreSource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * reference to the corresponding VSphere Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @param value The coreSource to set. + * @return This builder for chaining. + */ + public Builder setCoreSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + coreSource_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * reference to the corresponding VSphere Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @return This builder for chaining. + */ + public Builder clearCoreSource() { + coreSource_ = getDefaultInstance().getCoreSource(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * reference to the corresponding VSphere Scan in MC Source.
+     * 
+ * + * string core_source = 1; + * + * @param value The bytes for coreSource to set. + * @return This builder for chaining. + */ + public Builder setCoreSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + coreSource_ = value; + bitField0_ |= 0x00000001; + 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.rapidmigrationassessment.v1.VSphereScan) + } + + // @@protoc_insertion_point(class_scope:google.cloud.rapidmigrationassessment.v1.VSphereScan) + private static final com.google.cloud.rapidmigrationassessment.v1.VSphereScan DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.rapidmigrationassessment.v1.VSphereScan(); + } + + public static com.google.cloud.rapidmigrationassessment.v1.VSphereScan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VSphereScan 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.rapidmigrationassessment.v1.VSphereScan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScanOrBuilder.java b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScanOrBuilder.java new file mode 100644 index 000000000000..d05407651ee8 --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/java/com/google/cloud/rapidmigrationassessment/v1/VSphereScanOrBuilder.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/rapidmigrationassessment/v1/api_entities.proto + +package com.google.cloud.rapidmigrationassessment.v1; + +public interface VSphereScanOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.rapidmigrationassessment.v1.VSphereScan) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * reference to the corresponding VSphere Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The coreSource. + */ + java.lang.String getCoreSource(); + /** + * + * + *
+   * reference to the corresponding VSphere Scan in MC Source.
+   * 
+ * + * string core_source = 1; + * + * @return The bytes for coreSource. + */ + com.google.protobuf.ByteString getCoreSourceBytes(); +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/api_entities.proto b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/api_entities.proto new file mode 100644 index 000000000000..54a3247c536c --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/api_entities.proto @@ -0,0 +1,171 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.rapidmigrationassessment.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RapidMigrationAssessment.V1"; +option go_package = "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb"; +option java_multiple_files = true; +option java_outer_classname = "ApiEntitiesProto"; +option java_package = "com.google.cloud.rapidmigrationassessment.v1"; +option php_namespace = "Google\\Cloud\\RapidMigrationAssessment\\V1"; +option ruby_package = "Google::Cloud::RapidMigrationAssessment::V1"; + +// Message describing a MC Source of type Guest OS Scan. +message GuestOsScan { + // reference to the corresponding Guest OS Scan in MC Source. + string core_source = 1; +} + +// Message describing a MC Source of type VSphere Scan. +message VSphereScan { + // reference to the corresponding VSphere Scan in MC Source. + string core_source = 1; +} + +// Message describing Collector object. +message Collector { + option (google.api.resource) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + pattern: "projects/{project}/locations/{location}/collectors/{collector}" + }; + + // -- Using suggestion from API Linter Analyzer for nesting enum -- + // -- https://linter.aip.dev/216/nesting -- + // State of a Collector (server_side). + // States are used for internal purposes and named to keep + // convention of legacy product: + // https://cloud.google.com/migrate/stratozone/docs/about-stratoprobe. + enum State { + // Collector state is not recognized. + STATE_UNSPECIFIED = 0; + + // Collector started to create, but hasn't been completed MC source creation + // and db object creation. + STATE_INITIALIZING = 1; + + // Collector has been created, MC source creation and db object creation + // completed. + STATE_READY_TO_USE = 2; + + // Collector client has been registered with client. + STATE_REGISTERED = 3; + + // Collector client is actively scanning. + STATE_ACTIVE = 4; + + // Collector is not actively scanning. + STATE_PAUSED = 5; + + // Collector is starting background job for deletion. + STATE_DELETING = 6; + + // Collector completed all tasks for deletion. + STATE_DECOMMISSIONED = 7; + + // Collector is in error state. + STATE_ERROR = 8; + } + + // name of resource. + string name = 1; + + // Output only. Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // User specified name of the Collector. + string display_name = 5; + + // User specified description of the Collector. + string description = 6; + + // Service Account email used to ingest data to this Collector. + string service_account = 7; + + // Output only. Store cloud storage bucket name (which is a guid) created with + // this Collector. + string bucket = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified expected asset count. + int64 expected_asset_count = 9; + + // Output only. State of the Collector. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Client version. + string client_version = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reference to MC Source Guest Os Scan. + GuestOsScan guest_os_scan = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reference to MC Source vsphere_scan. + VSphereScan vsphere_scan = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // How many days to collect data. + int32 collection_days = 14; + + // Uri for EULA (End User License Agreement) from customer. + string eula_uri = 15; +} + +// Message describing an Annotation +message Annotation { + option (google.api.resource) = { + type: "rapidmigrationassessment.googleapis.com/Annotation" + pattern: "projects/{project}/locations/{location}/annotations/{annotation}" + }; + + // Types for project level setting. + enum Type { + // Unknown type + TYPE_UNSPECIFIED = 0; + + // Indicates that this project has opted into StratoZone export. + TYPE_LEGACY_EXPORT_CONSENT = 1; + + // Indicates that this project is created by Qwiklab. + TYPE_QWIKLAB = 2; + } + + // name of resource. + string name = 1; + + // Output only. Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels as key value pairs. + map labels = 4; + + // Type of an annotation. + Type type = 5; +} diff --git a/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto new file mode 100644 index 000000000000..4e4026efe04c --- /dev/null +++ b/java-rapidmigrationassessment/proto-google-cloud-rapidmigrationassessment-v1/src/main/proto/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto @@ -0,0 +1,421 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.rapidmigrationassessment.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/rapidmigrationassessment/v1/api_entities.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RapidMigrationAssessment.V1"; +option go_package = "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb;rapidmigrationassessmentpb"; +option java_multiple_files = true; +option java_outer_classname = "RapidMigrationAssessmentProto"; +option java_package = "com.google.cloud.rapidmigrationassessment.v1"; +option php_namespace = "Google\\Cloud\\RapidMigrationAssessment\\V1"; +option ruby_package = "Google::Cloud::RapidMigrationAssessment::V1"; + +// Rapid Migration Assessment service +service RapidMigrationAssessment { + option (google.api.default_host) = "rapidmigrationassessment.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a Collector to manage the on-prem appliance which collects + // information about Customer assets. + rpc CreateCollector(CreateCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/collectors" + body: "collector" + }; + option (google.api.method_signature) = "parent,collector,collector_id"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Creates an Annotation + rpc CreateAnnotation(CreateAnnotationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/annotations" + body: "annotation" + }; + option (google.api.method_signature) = "parent,annotation"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.rapidmigrationassessment.v1.Annotation" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single Annotation. + rpc GetAnnotation(GetAnnotationRequest) returns (Annotation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/annotations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Collectors in a given project and location. + rpc ListCollectors(ListCollectorsRequest) returns (ListCollectorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/collectors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Collector. + rpc GetCollector(GetCollectorRequest) returns (Collector) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/collectors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the parameters of a single Collector. + rpc UpdateCollector(UpdateCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{collector.name=projects/*/locations/*/collectors/*}" + body: "collector" + }; + option (google.api.method_signature) = "collector,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Collector - changes state of collector to "Deleting". + rpc DeleteCollector(DeleteCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/collectors/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Resumes the given collector. + rpc ResumeCollector(ResumeCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/collectors/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Registers the given collector. + rpc RegisterCollector(RegisterCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/collectors/*}:register" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } + + // Pauses the given collector. + rpc PauseCollector(PauseCollectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/collectors/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Collector" + metadata_type: "OperationMetadata" + }; + } +} + +// Message for creating an AnnotationS. +message CreateAnnotationRequest { + // Required. Name of the parent (project+location). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The resource being created. + Annotation annotation = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for getting a specific Annotation +message GetAnnotationRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Annotation" + } + ]; +} + +// Message for creating a Collector. +message CreateCollectorRequest { + // Required. Name of the parent (project+location). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Id of the requesting object. + string collector_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Collector collector = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Collectors. +message ListCollectorsRequest { + // Required. Parent value for ListCollectorsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Filtering results. + string filter = 4; + + // Hint for how to order the results. + string order_by = 5; +} + +// Message for response to listing Collectors. +message ListCollectorsResponse { + // The list of Collectors. + repeated Collector collectors = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a specific Collector. +message GetCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; +} + +// Message for deleting a Collector. +message DeleteCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Collector. +message UpdateCollectorRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Collector resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + Collector collector = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for resuming a Collector. +message ResumeCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for registering a Collector. +message RegisterCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for pausing a Collector. +message PauseCollectorRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "rapidmigrationassessment.googleapis.com/Collector" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..c3f67bfdf2fd --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentSettings; +import com.google.cloud.rapidmigrationassessment.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings = + RapidMigrationAssessmentSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_Create_SetCredentialsProvider_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider1.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..3617b9fa9f5b --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * 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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_Create_SetCredentialsProvider1_sync] +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentSettings; + +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 + RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings = + RapidMigrationAssessmentSettings.newHttpJsonBuilder().build(); + RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_Create_SetCredentialsProvider1_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetEndpoint.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..4e360e57fd28 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/create/SyncCreateSetEndpoint.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_Create_SetEndpoint_sync] +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentSettings; +import com.google.cloud.rapidmigrationassessment.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings = + RapidMigrationAssessmentSettings.newBuilder().setEndpoint(myEndpoint).build(); + RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create(rapidMigrationAssessmentSettings); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_Create_SetEndpoint_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotation.java new file mode 100644 index 000000000000..3f9d7ff0d66c --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.longrunning.Operation; + +public class AsyncCreateAnnotation { + + public static void main(String[] args) throws Exception { + asyncCreateAnnotation(); + } + + public static void asyncCreateAnnotation() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CreateAnnotationRequest request = + CreateAnnotationRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setAnnotation(Annotation.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.createAnnotationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotationLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotationLRO.java new file mode 100644 index 000000000000..262968bd96db --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/AsyncCreateAnnotationLRO.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncCreateAnnotationLRO { + + public static void main(String[] args) throws Exception { + asyncCreateAnnotationLRO(); + } + + public static void asyncCreateAnnotationLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CreateAnnotationRequest request = + CreateAnnotationRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setAnnotation(Annotation.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.createAnnotationOperationCallable().futureCall(request); + // Do something. + Annotation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotation.java new file mode 100644 index 000000000000..51a573b8ab73 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.CreateAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncCreateAnnotation { + + public static void main(String[] args) throws Exception { + syncCreateAnnotation(); + } + + public static void syncCreateAnnotation() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CreateAnnotationRequest request = + CreateAnnotationRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setAnnotation(Annotation.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Annotation response = rapidMigrationAssessmentClient.createAnnotationAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationLocationnameAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationLocationnameAnnotation.java new file mode 100644 index 000000000000..55b9b8c32630 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationLocationnameAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_LocationnameAnnotation_sync] +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncCreateAnnotationLocationnameAnnotation { + + public static void main(String[] args) throws Exception { + syncCreateAnnotationLocationnameAnnotation(); + } + + public static void syncCreateAnnotationLocationnameAnnotation() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Annotation annotation = Annotation.newBuilder().build(); + Annotation response = + rapidMigrationAssessmentClient.createAnnotationAsync(parent, annotation).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_LocationnameAnnotation_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationStringAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationStringAnnotation.java new file mode 100644 index 000000000000..6756c18ebb41 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createannotation/SyncCreateAnnotationStringAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_StringAnnotation_sync] +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncCreateAnnotationStringAnnotation { + + public static void main(String[] args) throws Exception { + syncCreateAnnotationStringAnnotation(); + } + + public static void syncCreateAnnotationStringAnnotation() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Annotation annotation = Annotation.newBuilder().build(); + Annotation response = + rapidMigrationAssessmentClient.createAnnotationAsync(parent, annotation).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateAnnotation_StringAnnotation_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollector.java new file mode 100644 index 000000000000..72595d7e0d76 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollector.java @@ -0,0 +1,55 @@ +/* + * 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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.longrunning.Operation; + +public class AsyncCreateCollector { + + public static void main(String[] args) throws Exception { + asyncCreateCollector(); + } + + public static void asyncCreateCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CreateCollectorRequest request = + CreateCollectorRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCollectorId("collectorId1854072456") + .setCollector(Collector.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.createCollectorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollectorLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollectorLRO.java new file mode 100644 index 000000000000..9cfeae7193a6 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/AsyncCreateCollectorLRO.java @@ -0,0 +1,55 @@ +/* + * 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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncCreateCollectorLRO { + + public static void main(String[] args) throws Exception { + asyncCreateCollectorLRO(); + } + + public static void asyncCreateCollectorLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CreateCollectorRequest request = + CreateCollectorRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCollectorId("collectorId1854072456") + .setCollector(Collector.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.createCollectorOperationCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollector.java new file mode 100644 index 000000000000..3c5fb784c30d --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CreateCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncCreateCollector { + + public static void main(String[] args) throws Exception { + syncCreateCollector(); + } + + public static void syncCreateCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CreateCollectorRequest request = + CreateCollectorRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCollectorId("collectorId1854072456") + .setCollector(Collector.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Collector response = rapidMigrationAssessmentClient.createCollectorAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorLocationnameCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorLocationnameCollectorString.java new file mode 100644 index 000000000000..f0050a72df8a --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorLocationnameCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_LocationnameCollectorString_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncCreateCollectorLocationnameCollectorString { + + public static void main(String[] args) throws Exception { + syncCreateCollectorLocationnameCollectorString(); + } + + public static void syncCreateCollectorLocationnameCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + Collector response = + rapidMigrationAssessmentClient.createCollectorAsync(parent, collector, collectorId).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_LocationnameCollectorString_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorStringCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorStringCollectorString.java new file mode 100644 index 000000000000..6474ea6e682e --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/createcollector/SyncCreateCollectorStringCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_StringCollectorString_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncCreateCollectorStringCollectorString { + + public static void main(String[] args) throws Exception { + syncCreateCollectorStringCollectorString(); + } + + public static void syncCreateCollectorStringCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Collector collector = Collector.newBuilder().build(); + String collectorId = "collectorId1854072456"; + Collector response = + rapidMigrationAssessmentClient.createCollectorAsync(parent, collector, collectorId).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_CreateCollector_StringCollectorString_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollector.java new file mode 100644 index 000000000000..7b4b7fb83152 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteCollector { + + public static void main(String[] args) throws Exception { + asyncDeleteCollector(); + } + + public static void asyncDeleteCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + DeleteCollectorRequest request = + DeleteCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.deleteCollectorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollectorLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollectorLRO.java new file mode 100644 index 000000000000..99c5599a242e --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/AsyncDeleteCollectorLRO.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncDeleteCollectorLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteCollectorLRO(); + } + + public static void asyncDeleteCollectorLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + DeleteCollectorRequest request = + DeleteCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.deleteCollectorOperationCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollector.java new file mode 100644 index 000000000000..f8344344cf17 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.DeleteCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncDeleteCollector { + + public static void main(String[] args) throws Exception { + syncDeleteCollector(); + } + + public static void syncDeleteCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + DeleteCollectorRequest request = + DeleteCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorCollectorname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorCollectorname.java new file mode 100644 index 000000000000..d1f6cdda48df --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorCollectorname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_Collectorname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncDeleteCollectorCollectorname { + + public static void main(String[] args) throws Exception { + syncDeleteCollectorCollectorname(); + } + + public static void syncDeleteCollectorCollectorname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_Collectorname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorString.java new file mode 100644 index 000000000000..f1e253f7f981 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/deletecollector/SyncDeleteCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncDeleteCollectorString { + + public static void main(String[] args) throws Exception { + syncDeleteCollectorString(); + } + + public static void syncDeleteCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); + Collector response = rapidMigrationAssessmentClient.deleteCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/AsyncGetAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/AsyncGetAnnotation.java new file mode 100644 index 000000000000..fa1e414f2a62 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/AsyncGetAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.AnnotationName; +import com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncGetAnnotation { + + public static void main(String[] args) throws Exception { + asyncGetAnnotation(); + } + + public static void asyncGetAnnotation() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + GetAnnotationRequest request = + GetAnnotationRequest.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.getAnnotationCallable().futureCall(request); + // Do something. + Annotation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotation.java new file mode 100644 index 000000000000..68ee3d03a981 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.AnnotationName; +import com.google.cloud.rapidmigrationassessment.v1.GetAnnotationRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncGetAnnotation { + + public static void main(String[] args) throws Exception { + syncGetAnnotation(); + } + + public static void syncGetAnnotation() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + GetAnnotationRequest request = + GetAnnotationRequest.newBuilder() + .setName(AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString()) + .build(); + Annotation response = rapidMigrationAssessmentClient.getAnnotation(request); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationAnnotationname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationAnnotationname.java new file mode 100644 index 000000000000..8c8168910dab --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationAnnotationname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_Annotationname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.AnnotationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncGetAnnotationAnnotationname { + + public static void main(String[] args) throws Exception { + syncGetAnnotationAnnotationname(); + } + + public static void syncGetAnnotationAnnotationname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + AnnotationName name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]"); + Annotation response = rapidMigrationAssessmentClient.getAnnotation(name); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_Annotationname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationString.java new file mode 100644 index 000000000000..55af0fd9bcda --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getannotation/SyncGetAnnotationString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Annotation; +import com.google.cloud.rapidmigrationassessment.v1.AnnotationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncGetAnnotationString { + + public static void main(String[] args) throws Exception { + syncGetAnnotationString(); + } + + public static void syncGetAnnotationString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String name = AnnotationName.of("[PROJECT]", "[LOCATION]", "[ANNOTATION]").toString(); + Annotation response = rapidMigrationAssessmentClient.getAnnotation(name); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetAnnotation_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/AsyncGetCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/AsyncGetCollector.java new file mode 100644 index 000000000000..40e7ace9f946 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/AsyncGetCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncGetCollector { + + public static void main(String[] args) throws Exception { + asyncGetCollector(); + } + + public static void asyncGetCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + GetCollectorRequest request = + GetCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.getCollectorCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollector.java new file mode 100644 index 000000000000..c4495acc8f93 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.GetCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncGetCollector { + + public static void main(String[] args) throws Exception { + syncGetCollector(); + } + + public static void syncGetCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + GetCollectorRequest request = + GetCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .build(); + Collector response = rapidMigrationAssessmentClient.getCollector(request); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorCollectorname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorCollectorname.java new file mode 100644 index 000000000000..c046f8e72709 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorCollectorname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_Collectorname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncGetCollectorCollectorname { + + public static void main(String[] args) throws Exception { + syncGetCollectorCollectorname(); + } + + public static void syncGetCollectorCollectorname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + Collector response = rapidMigrationAssessmentClient.getCollector(name); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_Collectorname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorString.java new file mode 100644 index 000000000000..b78cb9a5b215 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getcollector/SyncGetCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncGetCollectorString { + + public static void main(String[] args) throws Exception { + syncGetCollectorString(); + } + + public static void syncGetCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); + Collector response = rapidMigrationAssessmentClient.getCollector(name); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetCollector_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/AsyncGetLocation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..d6f63d56c04a --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/AsyncGetLocation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + rapidMigrationAssessmentClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetLocation_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/SyncGetLocation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..60733e948805 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/getlocation/SyncGetLocation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = rapidMigrationAssessmentClient.getLocation(request); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_GetLocation_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectors.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectors.java new file mode 100644 index 000000000000..ccc3296e82c9 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectors.java @@ -0,0 +1,57 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncListCollectors { + + public static void main(String[] args) throws Exception { + asyncListCollectors(); + } + + public static void asyncListCollectors() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ListCollectorsRequest request = + ListCollectorsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.listCollectorsPagedCallable().futureCall(request); + // Do something. + for (Collector element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectorsPaged.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectorsPaged.java new file mode 100644 index 000000000000..bb2b84261649 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/AsyncListCollectorsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_Paged_async] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsResponse; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.common.base.Strings; + +public class AsyncListCollectorsPaged { + + public static void main(String[] args) throws Exception { + asyncListCollectorsPaged(); + } + + public static void asyncListCollectorsPaged() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ListCollectorsRequest request = + ListCollectorsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListCollectorsResponse response = + rapidMigrationAssessmentClient.listCollectorsCallable().call(request); + for (Collector element : response.getCollectorsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_Paged_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectors.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectors.java new file mode 100644 index 000000000000..efc92d0e5fbb --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectors.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.ListCollectorsRequest; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncListCollectors { + + public static void main(String[] args) throws Exception { + syncListCollectors(); + } + + public static void syncListCollectors() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ListCollectorsRequest request = + ListCollectorsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Collector element : + rapidMigrationAssessmentClient.listCollectors(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsLocationname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsLocationname.java new file mode 100644 index 000000000000..1389b6eb711c --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsLocationname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_Locationname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncListCollectorsLocationname { + + public static void main(String[] args) throws Exception { + syncListCollectorsLocationname(); + } + + public static void syncListCollectorsLocationname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Collector element : rapidMigrationAssessmentClient.listCollectors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_Locationname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsString.java new file mode 100644 index 000000000000..310ea2cc9f6b --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listcollectors/SyncListCollectorsString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.LocationName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncListCollectorsString { + + public static void main(String[] args) throws Exception { + syncListCollectorsString(); + } + + public static void syncListCollectorsString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Collector element : rapidMigrationAssessmentClient.listCollectors(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListCollectors_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocations.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..5f498712661c --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocations.java @@ -0,0 +1,55 @@ +/* + * 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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocationsPaged.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..d6e78179e7db --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,63 @@ +/* + * 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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_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.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + rapidMigrationAssessmentClient.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 rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_Paged_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/SyncListLocations.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..8ecd92ca1308 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/listlocations/SyncListLocations.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : rapidMigrationAssessmentClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ListLocations_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollector.java new file mode 100644 index 000000000000..dc6d8c297b0a --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.longrunning.Operation; + +public class AsyncPauseCollector { + + public static void main(String[] args) throws Exception { + asyncPauseCollector(); + } + + public static void asyncPauseCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + PauseCollectorRequest request = + PauseCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.pauseCollectorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollectorLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollectorLRO.java new file mode 100644 index 000000000000..9c60127f2f54 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/AsyncPauseCollectorLRO.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class AsyncPauseCollectorLRO { + + public static void main(String[] args) throws Exception { + asyncPauseCollectorLRO(); + } + + public static void asyncPauseCollectorLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + PauseCollectorRequest request = + PauseCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.pauseCollectorOperationCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollector.java new file mode 100644 index 000000000000..722402d8fe68 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.PauseCollectorRequest; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncPauseCollector { + + public static void main(String[] args) throws Exception { + syncPauseCollector(); + } + + public static void syncPauseCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + PauseCollectorRequest request = + PauseCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorCollectorname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorCollectorname.java new file mode 100644 index 000000000000..c9ca9a3c006b --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorCollectorname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_Collectorname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncPauseCollectorCollectorname { + + public static void main(String[] args) throws Exception { + syncPauseCollectorCollectorname(); + } + + public static void syncPauseCollectorCollectorname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_Collectorname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorString.java new file mode 100644 index 000000000000..211d12675ab7 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/pausecollector/SyncPauseCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncPauseCollectorString { + + public static void main(String[] args) throws Exception { + syncPauseCollectorString(); + } + + public static void syncPauseCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); + Collector response = rapidMigrationAssessmentClient.pauseCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_PauseCollector_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollector.java new file mode 100644 index 000000000000..c4bef4260479 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; +import com.google.longrunning.Operation; + +public class AsyncRegisterCollector { + + public static void main(String[] args) throws Exception { + asyncRegisterCollector(); + } + + public static void asyncRegisterCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + RegisterCollectorRequest request = + RegisterCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.registerCollectorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollectorLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollectorLRO.java new file mode 100644 index 000000000000..e7a749f04c2a --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/AsyncRegisterCollectorLRO.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; + +public class AsyncRegisterCollectorLRO { + + public static void main(String[] args) throws Exception { + asyncRegisterCollectorLRO(); + } + + public static void asyncRegisterCollectorLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + RegisterCollectorRequest request = + RegisterCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.registerCollectorOperationCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollector.java new file mode 100644 index 000000000000..45d9e7471e3f --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.RegisterCollectorRequest; + +public class SyncRegisterCollector { + + public static void main(String[] args) throws Exception { + syncRegisterCollector(); + } + + public static void syncRegisterCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + RegisterCollectorRequest request = + RegisterCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorCollectorname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorCollectorname.java new file mode 100644 index 000000000000..8b6e99fae3c7 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorCollectorname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_Collectorname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncRegisterCollectorCollectorname { + + public static void main(String[] args) throws Exception { + syncRegisterCollectorCollectorname(); + } + + public static void syncRegisterCollectorCollectorname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_Collectorname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorString.java new file mode 100644 index 000000000000..af09cc4cf09b --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/registercollector/SyncRegisterCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncRegisterCollectorString { + + public static void main(String[] args) throws Exception { + syncRegisterCollectorString(); + } + + public static void syncRegisterCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); + Collector response = rapidMigrationAssessmentClient.registerCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_RegisterCollector_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollector.java new file mode 100644 index 000000000000..35d11c435c70 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; +import com.google.longrunning.Operation; + +public class AsyncResumeCollector { + + public static void main(String[] args) throws Exception { + asyncResumeCollector(); + } + + public static void asyncResumeCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ResumeCollectorRequest request = + ResumeCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.resumeCollectorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollectorLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollectorLRO.java new file mode 100644 index 000000000000..6471ddc67f04 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/AsyncResumeCollectorLRO.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; + +public class AsyncResumeCollectorLRO { + + public static void main(String[] args) throws Exception { + asyncResumeCollectorLRO(); + } + + public static void asyncResumeCollectorLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ResumeCollectorRequest request = + ResumeCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.resumeCollectorOperationCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollector.java new file mode 100644 index 000000000000..536d93be1555 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.ResumeCollectorRequest; + +public class SyncResumeCollector { + + public static void main(String[] args) throws Exception { + syncResumeCollector(); + } + + public static void syncResumeCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + ResumeCollectorRequest request = + ResumeCollectorRequest.newBuilder() + .setName(CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString()) + .setRequestId("requestId693933066") + .build(); + Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorCollectorname.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorCollectorname.java new file mode 100644 index 000000000000..a95a0ce1b2fe --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorCollectorname.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_Collectorname_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncResumeCollectorCollectorname { + + public static void main(String[] args) throws Exception { + syncResumeCollectorCollectorname(); + } + + public static void syncResumeCollectorCollectorname() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + CollectorName name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]"); + Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_Collectorname_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorString.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorString.java new file mode 100644 index 000000000000..fc5ad71e078f --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/resumecollector/SyncResumeCollectorString.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_String_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.CollectorName; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; + +public class SyncResumeCollectorString { + + public static void main(String[] args) throws Exception { + syncResumeCollectorString(); + } + + public static void syncResumeCollectorString() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + String name = CollectorName.of("[PROJECT]", "[LOCATION]", "[COLLECTOR]").toString(); + Collector response = rapidMigrationAssessmentClient.resumeCollectorAsync(name).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_ResumeCollector_String_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollector.java new file mode 100644 index 000000000000..4c639e9b4584 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCollector { + + public static void main(String[] args) throws Exception { + asyncUpdateCollector(); + } + + public static void asyncUpdateCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + UpdateCollectorRequest request = + UpdateCollectorRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCollector(Collector.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + rapidMigrationAssessmentClient.updateCollectorCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollectorLRO.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollectorLRO.java new file mode 100644 index 000000000000..50728a3db599 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/AsyncUpdateCollectorLRO.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.OperationMetadata; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCollectorLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateCollectorLRO(); + } + + public static void asyncUpdateCollectorLRO() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + UpdateCollectorRequest request = + UpdateCollectorRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCollector(Collector.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + rapidMigrationAssessmentClient.updateCollectorOperationCallable().futureCall(request); + // Do something. + Collector response = future.get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_LRO_async] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollector.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollector.java new file mode 100644 index 000000000000..78795b641557 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollector.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.cloud.rapidmigrationassessment.v1.UpdateCollectorRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCollector { + + public static void main(String[] args) throws Exception { + syncUpdateCollector(); + } + + public static void syncUpdateCollector() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + UpdateCollectorRequest request = + UpdateCollectorRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCollector(Collector.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Collector response = rapidMigrationAssessmentClient.updateCollectorAsync(request).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollectorCollectorFieldmask.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollectorCollectorFieldmask.java new file mode 100644 index 000000000000..916f619ab81a --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment/updatecollector/SyncUpdateCollectorCollectorFieldmask.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_CollectorFieldmask_sync] +import com.google.cloud.rapidmigrationassessment.v1.Collector; +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCollectorCollectorFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateCollectorCollectorFieldmask(); + } + + public static void syncUpdateCollectorCollectorFieldmask() 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 (RapidMigrationAssessmentClient rapidMigrationAssessmentClient = + RapidMigrationAssessmentClient.create()) { + Collector collector = Collector.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Collector response = + rapidMigrationAssessmentClient.updateCollectorAsync(collector, updateMask).get(); + } + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessment_UpdateCollector_CollectorFieldmask_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessmentsettings/getannotation/SyncGetAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessmentsettings/getannotation/SyncGetAnnotation.java new file mode 100644 index 000000000000..b70627c4db60 --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessmentsettings/getannotation/SyncGetAnnotation.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.rapidmigrationassessment.v1.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessmentSettings_GetAnnotation_sync] +import com.google.cloud.rapidmigrationassessment.v1.RapidMigrationAssessmentSettings; +import java.time.Duration; + +public class SyncGetAnnotation { + + public static void main(String[] args) throws Exception { + syncGetAnnotation(); + } + + public static void syncGetAnnotation() 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 + RapidMigrationAssessmentSettings.Builder rapidMigrationAssessmentSettingsBuilder = + RapidMigrationAssessmentSettings.newBuilder(); + rapidMigrationAssessmentSettingsBuilder + .getAnnotationSettings() + .setRetrySettings( + rapidMigrationAssessmentSettingsBuilder + .getAnnotationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RapidMigrationAssessmentSettings rapidMigrationAssessmentSettings = + rapidMigrationAssessmentSettingsBuilder.build(); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessmentSettings_GetAnnotation_sync] diff --git a/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/stub/rapidmigrationassessmentstubsettings/getannotation/SyncGetAnnotation.java b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/stub/rapidmigrationassessmentstubsettings/getannotation/SyncGetAnnotation.java new file mode 100644 index 000000000000..b1b0c951201b --- /dev/null +++ b/java-rapidmigrationassessment/samples/snippets/generated/com/google/cloud/rapidmigrationassessment/v1/stub/rapidmigrationassessmentstubsettings/getannotation/SyncGetAnnotation.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.rapidmigrationassessment.v1.stub.samples; + +// [START rapidmigrationassessment_v1_generated_RapidMigrationAssessmentStubSettings_GetAnnotation_sync] +import com.google.cloud.rapidmigrationassessment.v1.stub.RapidMigrationAssessmentStubSettings; +import java.time.Duration; + +public class SyncGetAnnotation { + + public static void main(String[] args) throws Exception { + syncGetAnnotation(); + } + + public static void syncGetAnnotation() 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 + RapidMigrationAssessmentStubSettings.Builder rapidMigrationAssessmentSettingsBuilder = + RapidMigrationAssessmentStubSettings.newBuilder(); + rapidMigrationAssessmentSettingsBuilder + .getAnnotationSettings() + .setRetrySettings( + rapidMigrationAssessmentSettingsBuilder + .getAnnotationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RapidMigrationAssessmentStubSettings rapidMigrationAssessmentSettings = + rapidMigrationAssessmentSettingsBuilder.build(); + } +} +// [END rapidmigrationassessment_v1_generated_RapidMigrationAssessmentStubSettings_GetAnnotation_sync] diff --git a/pom.xml b/pom.xml index 810d25f60131..567604e333e4 100644 --- a/pom.xml +++ b/pom.xml @@ -128,6 +128,7 @@ java-private-catalog java-profiler java-publicca + java-rapidmigrationassessment java-recaptchaenterprise java-recommendations-ai java-recommender diff --git a/versions.txt b/versions.txt index 00e9ddca7224..825b5a762157 100644 --- a/versions.txt +++ b/versions.txt @@ -643,3 +643,6 @@ grpc-google-cloud-storageinsights-v1:0.2.0:0.3.0-SNAPSHOT google-cloud-cloudsupport:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-cloudsupport-v2:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-cloudsupport-v2:0.1.0:0.2.0-SNAPSHOT +google-cloud-rapidmigrationassessment:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-rapidmigrationassessment-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-rapidmigrationassessment-v1:0.0.0:0.0.1-SNAPSHOT From eb0b4d526390d0ac00a196ae640cf42bdae357af Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 25 May 2023 23:05:19 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-rapidmigrationassessment-bom/pom.xml | 2 +- .../google-cloud-rapidmigrationassessment/pom.xml | 4 ++-- java-rapidmigrationassessment/pom.xml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml index 55db8fb25397..86949ff25136 100644 --- a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment-bom/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud diff --git a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml index c01457c698bb..48be5b5a4198 100644 --- a/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml +++ b/java-rapidmigrationassessment/google-cloud-rapidmigrationassessment/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -110,4 +110,4 @@ test - \ No newline at end of file + diff --git a/java-rapidmigrationassessment/pom.xml b/java-rapidmigrationassessment/pom.xml index 721ef2cd64af..b0c48e99a411 100644 --- a/java-rapidmigrationassessment/pom.xml +++ b/java-rapidmigrationassessment/pom.xml @@ -50,4 +50,5 @@ proto-google-cloud-rapidmigrationassessment-v1 google-cloud-rapidmigrationassessment-bom - + +