From 2426c7f14b3eee51f1e6f174c255553db1677d4b Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 13 Mar 2020 07:46:20 -0700 Subject: [PATCH] feat: initial generation --- .github/ISSUE_TEMPLATE/bug_report.md | 51 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 1 + .github/release-please.yml | 2 + .gitignore | 15 + .kokoro/build.bat | 3 + .kokoro/build.sh | 108 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/dependencies.cfg | 12 + .kokoro/continuous/integration.cfg | 7 + .kokoro/continuous/java11.cfg | 7 + .kokoro/continuous/java7.cfg | 7 + .kokoro/continuous/java8-osx.cfg | 3 + .kokoro/continuous/java8-win.cfg | 3 + .kokoro/continuous/java8.cfg | 12 + .kokoro/continuous/lint.cfg | 13 + .kokoro/continuous/propose_release.cfg | 53 + .kokoro/continuous/propose_release.sh | 29 + .kokoro/continuous/samples.cfg | 31 + .kokoro/dependencies.sh | 31 + .kokoro/linkage-monitor.sh | 38 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/dependencies.cfg | 12 + .kokoro/nightly/integration.cfg | 21 + .kokoro/nightly/java11.cfg | 7 + .kokoro/nightly/java7.cfg | 7 + .kokoro/nightly/java8-osx.cfg | 3 + .kokoro/nightly/java8-win.cfg | 3 + .kokoro/nightly/java8.cfg | 12 + .kokoro/nightly/lint.cfg | 13 + .kokoro/nightly/samples.cfg | 36 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 31 + .kokoro/presubmit/java11.cfg | 7 + .kokoro/presubmit/java7.cfg | 7 + .kokoro/presubmit/java8-osx.cfg | 3 + .kokoro/presubmit/java8-win.cfg | 3 + .kokoro/presubmit/java8.cfg | 12 + .kokoro/presubmit/linkage-monitor.cfg | 12 + .kokoro/presubmit/lint.cfg | 13 + .kokoro/presubmit/samples.cfg | 31 + .kokoro/release/bump_snapshot.cfg | 53 + .kokoro/release/bump_snapshot.sh | 30 + .kokoro/release/common.cfg | 49 + .kokoro/release/common.sh | 50 + .kokoro/release/drop.cfg | 6 + .kokoro/release/drop.sh | 32 + .kokoro/release/promote.cfg | 6 + .kokoro/release/promote.sh | 34 + .kokoro/release/publish_javadoc.cfg | 19 + .kokoro/release/publish_javadoc.sh | 55 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 44 + .kokoro/release/stage.sh | 42 + .kokoro/trampoline.sh | 24 + .repo-metadata.json | 14 + CODE_OF_CONDUCT.md | 93 + CONTRIBUTING.md | 130 + LICENSE | 202 ++ README.md | 163 ++ codecov.yaml | 4 + google-cloud-servicedirectory-bom/pom.xml | 93 + google-cloud-servicedirectory/pom.xml | 105 + .../v1beta1/LookupServiceClient.java | 227 ++ .../v1beta1/LookupServiceSettings.java | 181 ++ .../v1beta1/RegistrationServiceClient.java | 2107 +++++++++++++++ .../v1beta1/RegistrationServiceSettings.java | 373 +++ .../v1beta1/package-info.java | 71 + .../GrpcLookupServiceCallableFactory.java | 115 + .../v1beta1/stub/GrpcLookupServiceStub.java | 156 ++ ...rpcRegistrationServiceCallableFactory.java | 115 + .../stub/GrpcRegistrationServiceStub.java | 738 +++++ .../v1beta1/stub/LookupServiceStub.java | 41 + .../stub/LookupServiceStubSettings.java | 274 ++ .../v1beta1/stub/RegistrationServiceStub.java | 153 ++ .../stub/RegistrationServiceStubSettings.java | 889 ++++++ .../v1beta1/LookupServiceClientTest.java | 121 + .../v1beta1/MockLookupService.java | 57 + .../v1beta1/MockLookupServiceImpl.java | 73 + .../v1beta1/MockRegistrationService.java | 57 + .../v1beta1/MockRegistrationServiceImpl.java | 330 +++ .../RegistrationServiceClientTest.java | 895 ++++++ .../pom.xml | 60 + .../v1beta1/LookupServiceGrpc.java | 363 +++ .../v1beta1/RegistrationServiceGrpc.java | 2397 +++++++++++++++++ java.header | 15 + license-checks.xml | 10 + pom.xml | 262 ++ .../pom.xml | 37 + .../v1beta1/CreateEndpointRequest.java | 1175 ++++++++ .../CreateEndpointRequestOrBuilder.java | 132 + .../v1beta1/CreateNamespaceRequest.java | 1182 ++++++++ .../CreateNamespaceRequestOrBuilder.java | 134 + .../v1beta1/CreateServiceRequest.java | 1174 ++++++++ .../CreateServiceRequestOrBuilder.java | 132 + .../v1beta1/DeleteEndpointRequest.java | 656 +++++ .../DeleteEndpointRequestOrBuilder.java | 54 + .../v1beta1/DeleteNamespaceRequest.java | 656 +++++ .../DeleteNamespaceRequestOrBuilder.java | 54 + .../v1beta1/DeleteServiceRequest.java | 655 +++++ .../DeleteServiceRequestOrBuilder.java | 54 + .../servicedirectory/v1beta1/Endpoint.java | 1317 +++++++++ .../v1beta1/EndpointName.java | 277 ++ .../v1beta1/EndpointOrBuilder.java | 173 ++ .../v1beta1/EndpointProto.java | 104 + .../v1beta1/GetEndpointRequest.java | 656 +++++ .../v1beta1/GetEndpointRequestOrBuilder.java | 54 + .../v1beta1/GetNamespaceRequest.java | 653 +++++ .../v1beta1/GetNamespaceRequestOrBuilder.java | 54 + .../v1beta1/GetServiceRequest.java | 653 +++++ .../v1beta1/GetServiceRequestOrBuilder.java | 54 + .../v1beta1/ListEndpointsRequest.java | 1442 ++++++++++ .../ListEndpointsRequestOrBuilder.java | 190 ++ .../v1beta1/ListEndpointsResponse.java | 1147 ++++++++ .../ListEndpointsResponseOrBuilder.java | 104 + .../v1beta1/ListNamespacesRequest.java | 1471 ++++++++++ .../ListNamespacesRequestOrBuilder.java | 198 ++ .../v1beta1/ListNamespacesResponse.java | 1148 ++++++++ .../ListNamespacesResponseOrBuilder.java | 104 + .../v1beta1/ListServicesRequest.java | 1426 ++++++++++ .../v1beta1/ListServicesRequestOrBuilder.java | 186 ++ .../v1beta1/ListServicesResponse.java | 1142 ++++++++ .../ListServicesResponseOrBuilder.java | 104 + .../v1beta1/LocationName.java | 182 ++ .../v1beta1/LookupServiceProto.java | 117 + .../servicedirectory/v1beta1/Namespace.java | 981 +++++++ .../v1beta1/NamespaceName.java | 211 ++ .../v1beta1/NamespaceOrBuilder.java | 116 + .../v1beta1/NamespaceProto.java | 102 + .../v1beta1/RegistrationServiceProto.java | 479 ++++ .../v1beta1/ResolveServiceRequest.java | 1036 +++++++ .../ResolveServiceRequestOrBuilder.java | 124 + .../v1beta1/ResolveServiceResponse.java | 652 +++++ .../ResolveServiceResponseOrBuilder.java | 40 + .../servicedirectory/v1beta1/Service.java | 1568 +++++++++++ .../servicedirectory/v1beta1/ServiceName.java | 242 ++ .../v1beta1/ServiceOrBuilder.java | 188 ++ .../v1beta1/ServiceProto.java | 108 + .../v1beta1/UpdateEndpointRequest.java | 1045 +++++++ .../UpdateEndpointRequestOrBuilder.java | 104 + .../v1beta1/UpdateNamespaceRequest.java | 1045 +++++++ .../UpdateNamespaceRequestOrBuilder.java | 104 + .../v1beta1/UpdateServiceRequest.java | 1044 +++++++ .../UpdateServiceRequestOrBuilder.java | 104 + .../servicedirectory/v1beta1/endpoint.proto | 60 + .../v1beta1/lookup_service.proto | 87 + .../servicedirectory/v1beta1/namespace.proto | 46 + .../v1beta1/registration_service.proto | 566 ++++ .../servicedirectory/v1beta1/service.proto | 53 + renovate.json | 78 + synth.metadata | 31 + synth.py | 33 + versions.txt | 6 + 159 files changed, 41518 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/release-please.yml create mode 100644 .gitignore create mode 100644 .kokoro/build.bat create mode 100755 .kokoro/build.sh create mode 100755 .kokoro/coerce_logs.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/dependencies.cfg create mode 100644 .kokoro/continuous/integration.cfg create mode 100644 .kokoro/continuous/java11.cfg create mode 100644 .kokoro/continuous/java7.cfg create mode 100644 .kokoro/continuous/java8-osx.cfg create mode 100644 .kokoro/continuous/java8-win.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100644 .kokoro/continuous/lint.cfg create mode 100644 .kokoro/continuous/propose_release.cfg create mode 100755 .kokoro/continuous/propose_release.sh create mode 100644 .kokoro/continuous/samples.cfg create mode 100755 .kokoro/dependencies.sh create mode 100755 .kokoro/linkage-monitor.sh create mode 100644 .kokoro/nightly/common.cfg create mode 100644 .kokoro/nightly/dependencies.cfg create mode 100644 .kokoro/nightly/integration.cfg create mode 100644 .kokoro/nightly/java11.cfg create mode 100644 .kokoro/nightly/java7.cfg create mode 100644 .kokoro/nightly/java8-osx.cfg create mode 100644 .kokoro/nightly/java8-win.cfg create mode 100644 .kokoro/nightly/java8.cfg create mode 100644 .kokoro/nightly/lint.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100644 .kokoro/presubmit/clirr.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/dependencies.cfg create mode 100644 .kokoro/presubmit/integration.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8-osx.cfg create mode 100644 .kokoro/presubmit/java8-win.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/linkage-monitor.cfg create mode 100644 .kokoro/presubmit/lint.cfg create mode 100644 .kokoro/presubmit/samples.cfg create mode 100644 .kokoro/release/bump_snapshot.cfg create mode 100755 .kokoro/release/bump_snapshot.sh create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/snapshot.cfg create mode 100755 .kokoro/release/snapshot.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100644 .kokoro/trampoline.sh create mode 100644 .repo-metadata.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 codecov.yaml create mode 100644 google-cloud-servicedirectory-bom/pom.xml create mode 100644 google-cloud-servicedirectory/pom.xml create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceSettings.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceSettings.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceCallableFactory.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceCallableFactory.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStub.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStubSettings.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStub.java create mode 100644 google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStubSettings.java create mode 100644 google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClientTest.java create mode 100644 google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupService.java create mode 100644 google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java create mode 100644 google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationService.java create mode 100644 google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java create mode 100644 google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClientTest.java create mode 100644 grpc-google-cloud-servicedirectory-v1beta1/pom.xml create mode 100644 grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceGrpc.java create mode 100644 grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 pom.xml create mode 100644 proto-google-cloud-servicedirectory-v1beta1/pom.xml create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Endpoint.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointName.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointProto.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponse.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponseOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponse.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponseOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponse.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponseOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LocationName.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceProto.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Namespace.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceName.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceProto.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceProto.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponse.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponseOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Service.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceName.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceProto.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequest.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequestOrBuilder.java create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/endpoint.proto create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/lookup_service.proto create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/namespace.proto create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/registration_service.proto create mode 100644 proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/service.proto create mode 100644 renovate.json create mode 100644 synth.metadata create mode 100644 synth.py create mode 100644 versions.txt diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..5efbe652 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-servicedirectory/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. servicedirectory version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..0bd0ee06 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1 @@ +Fixes # (it's a good idea to open an issue first for context and/or discussion) \ No newline at end of file diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..dce2c845 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fadd6afc --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..8a792f51 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" github/java-servicedirectory/.kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..cdcca3e1 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_ROOT}/src/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn \ + -Penable-samples \ + com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + if [[ -f samples/pom.xml ]] + then + pushd samples + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-servicedirectory +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..13159ee0 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/build.sh" +} diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..d16695b4 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/dependencies.cfg b/.kokoro/continuous/dependencies.cfg new file mode 100644 index 00000000..d22c15b5 --- /dev/null +++ b/.kokoro/continuous/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/dependencies.sh" +} diff --git a/.kokoro/continuous/integration.cfg b/.kokoro/continuous/integration.cfg new file mode 100644 index 00000000..3b017fc8 --- /dev/null +++ b/.kokoro/continuous/integration.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} diff --git a/.kokoro/continuous/java11.cfg b/.kokoro/continuous/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/continuous/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/continuous/java7.cfg b/.kokoro/continuous/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/continuous/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/continuous/java8-osx.cfg b/.kokoro/continuous/java8-osx.cfg new file mode 100644 index 00000000..e9794976 --- /dev/null +++ b/.kokoro/continuous/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-servicedirectory/.kokoro/build.sh" diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 00000000..ae1f45f7 --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-servicedirectory/.kokoro/build.bat" diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/continuous/lint.cfg b/.kokoro/continuous/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/continuous/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/continuous/propose_release.cfg b/.kokoro/continuous/propose_release.cfg new file mode 100644 index 00000000..3c357b1d --- /dev/null +++ b/.kokoro/continuous/propose_release.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/continuous/propose_release.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/continuous/propose_release.sh b/.kokoro/continuous/propose_release.sh new file mode 100755 index 00000000..d92ecef5 --- /dev/null +++ b/.kokoro/continuous/propose_release.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the release PR as new commits are merged. + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-servicedirectory \ + --package-name="servicedirectory" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --release-type=java-yoshi +fi diff --git a/.kokoro/continuous/samples.cfg b/.kokoro/continuous/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/continuous/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..4ab41c9a --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +cd github/java-servicedirectory/ + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 00000000..80ad03b8 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +# Display commands being run. +set -x + +cd github/java-servicedirectory/ + +# Print out Java version +java -version +echo ${JOB_TYPE} + +mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..d16695b4 --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/dependencies.cfg b/.kokoro/nightly/dependencies.cfg new file mode 100644 index 00000000..d22c15b5 --- /dev/null +++ b/.kokoro/nightly/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/dependencies.sh" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..8bf59c02 --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,21 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..e9794976 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-servicedirectory/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..ae1f45f7 --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-servicedirectory/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/lint.cfg b/.kokoro/nightly/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/nightly/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..b4b051cd --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,36 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..2be22b27 --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..d22c15b5 --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..141f90c1 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..e9794976 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-servicedirectory/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..ae1f45f7 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-servicedirectory/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..24b28b4d --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..fa7b493d --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,31 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "keystore/73713_java_it_service_account" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "java_it_service_account" + } + } +} diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..48102e51 --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh new file mode 100755 index 00000000..ae8fbb3d --- /dev/null +++ b/.kokoro/release/bump_snapshot.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the snapshot release PR immediately after publishing a release + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-servicedirectory \ + --package-name="servicedirectory" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --snapshot \ + --release-type=java-auth-yoshi +fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..5164adaa --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-servicedirectory/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..6941a916 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..4bd6771b --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..50e1362a --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/release/publish_javadoc.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..7fdca451 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -DskipTests=true + +NAME=google-cloud-servicedirectory +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..2fe52592 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..098168a7 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..7a42a125 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,44 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-servicedirectory/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-servicedirectory/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-servicedirectory" + } +} + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..3c482cbc --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..ba17ce01 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..87eba306 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "name": "servicedirectory", + "name_pretty": "Service Directory", + "product_documentation": "https://cloud.google.com/service-directory/", + "api_description": "allows the registration and lookup of service endpoints.", + "client_documentation": "https://googleapis.dev/java/google-cloud-servicedirectory/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-servicedirectory", + "repo_short": "java-servicedirectory", + "distribution_name": "com.google.cloud:google-cloud-servicedirectory", + "api_id": "servicedirectory.googleapis.com" +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..6b2238bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the +Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..085021dd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,130 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 00000000..e0f21b7c --- /dev/null +++ b/README.md @@ -0,0 +1,163 @@ +# Google Service Directory Client for Java + +Java idiomatic client for [Service Directory][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 + 4.2.0 + pom + import + + + + + + com.google.cloud + google-cloud-servicedirectory + + +``` + +[//]: # ({x-version-update-start:google-cloud-servicedirectory:released}) + +If you are using Maven without BOM, add this to your dependencies: + +```xml + + com.google.cloud + google-cloud-servicedirectory + 0.0.0 + +``` + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-servicedirectory:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-servicedirectory" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Service Directory [API enabled][enable-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 SDK][cloud-sdk] 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-servicedirectory` library. See the [Quickstart](#quickstart) section +to add `google-cloud-servicedirectory` as a dependency in your code. + +## About Service Directory + + +[Service Directory][product-docs] allows the registration and lookup of service endpoints. + +See the [Service Directory client library docs][javadocs] to learn how to +use this Service Directory Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Service Directory uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## 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 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] +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] + +[product-docs]: https://cloud.google.com/service-directory/ +[javadocs]: https://googleapis.dev/java/google-cloud-servicedirectory/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-servicedirectory/java11.html +[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-servicedirectory.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-servicedirectory&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-servicedirectory/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-servicedirectory/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-servicedirectory/blob/master/LICENSE + +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=servicedirectory.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 diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-servicedirectory-bom/pom.xml b/google-cloud-servicedirectory-bom/pom.xml new file mode 100644 index 00000000..81ada9cd --- /dev/null +++ b/google-cloud-servicedirectory-bom/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + com.google.cloud + google-cloud-servicedirectory-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.4.0 + + + Google Cloud Service Directory BOM + https://github.com/googleapis/java-servicedirectory + + BOM for Google Cloud Service Directory + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-servicedirectory.git + scm:git:git@github.com:googleapis/java-servicedirectory.git + https://github.com/googleapis/java-servicedirectory + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + + com.google.cloud + google-cloud-servicedirectory + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-servicedirectory-v1beta1 + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-servicedirectory/pom.xml b/google-cloud-servicedirectory/pom.xml new file mode 100644 index 00000000..f9e51380 --- /dev/null +++ b/google-cloud-servicedirectory/pom.xml @@ -0,0 +1,105 @@ + + + 4.0.0 + com.google.cloud + google-cloud-servicedirectory + 0.0.1-SNAPSHOT + jar + Google Cloud Service Directory + https://github.com/googleapis/java-servicedirectory + Java idiomatic client for Google Cloud Service Directory + + com.google.cloud + google-cloud-servicedirectory-parent + 0.0.1-SNAPSHOT + + + google-cloud-servicedirectory + + + + 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-iam-v1 + + + + com.google.api.grpc + proto-google-cloud-servicedirectory-v1beta1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1beta1 + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java new file mode 100644 index 00000000..c80c304c --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java @@ -0,0 +1,227 @@ +/* + * 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.servicedirectory.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.servicedirectory.v1beta1.stub.LookupServiceStub; +import com.google.cloud.servicedirectory.v1beta1.stub.LookupServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service Directory API for looking up service data at runtime. + * + *

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: + * + *

+ * 
+ * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+ *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+ *   ResolveServiceRequest request = ResolveServiceRequest.newBuilder()
+ *     .setName(name.toString())
+ *     .build();
+ *   ResolveServiceResponse response = lookupServiceClient.resolveService(request);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * LookupServiceSettings lookupServiceSettings =
+ *     LookupServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LookupServiceClient lookupServiceClient =
+ *     LookupServiceClient.create(lookupServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * LookupServiceSettings lookupServiceSettings =
+ *     LookupServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LookupServiceClient lookupServiceClient =
+ *     LookupServiceClient.create(lookupServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class LookupServiceClient implements BackgroundResource { + private final LookupServiceSettings settings; + private final LookupServiceStub stub; + + /** Constructs an instance of LookupServiceClient with default settings. */ + public static final LookupServiceClient create() throws IOException { + return create(LookupServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LookupServiceClient, 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 LookupServiceClient create(LookupServiceSettings settings) + throws IOException { + return new LookupServiceClient(settings); + } + + /** + * Constructs an instance of LookupServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer to use LookupServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final LookupServiceClient create(LookupServiceStub stub) { + return new LookupServiceClient(stub); + } + + /** + * Constructs an instance of LookupServiceClient, 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 LookupServiceClient(LookupServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LookupServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected LookupServiceClient(LookupServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LookupServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LookupServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its associated + * endpoints. Resolving a service is not considered an active developer method. + * + *

Sample code: + * + *


+   * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   ResolveServiceRequest request = ResolveServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ResolveServiceResponse response = lookupServiceClient.resolveService(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 ResolveServiceResponse resolveService(ResolveServiceRequest request) { + return resolveServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its associated + * endpoints. Resolving a service is not considered an active developer method. + * + *

Sample code: + * + *


+   * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   ResolveServiceRequest request = ResolveServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<ResolveServiceResponse> future = lookupServiceClient.resolveServiceCallable().futureCall(request);
+   *   // Do something
+   *   ResolveServiceResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + resolveServiceCallable() { + return stub.resolveServiceCallable(); + } + + @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); + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceSettings.java new file mode 100644 index 00000000..5358c8df --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceSettings.java @@ -0,0 +1,181 @@ +/* + * 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.servicedirectory.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.servicedirectory.v1beta1.stub.LookupServiceStubSettings; +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 LookupServiceClient}. + * + *

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

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

+ * 
+ * LookupServiceSettings.Builder lookupServiceSettingsBuilder =
+ *     LookupServiceSettings.newBuilder();
+ * lookupServiceSettingsBuilder
+ *     .resolveServiceSettings()
+ *     .setRetrySettings(
+ *         lookupServiceSettingsBuilder.resolveServiceSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LookupServiceSettings lookupServiceSettings = lookupServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class LookupServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to resolveService. */ + public UnaryCallSettings resolveServiceSettings() { + return ((LookupServiceStubSettings) getStubSettings()).resolveServiceSettings(); + } + + public static final LookupServiceSettings create(LookupServiceStubSettings stub) + throws IOException { + return new LookupServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LookupServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return LookupServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return LookupServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LookupServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return LookupServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LookupServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LookupServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LookupServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for LookupServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(LookupServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(LookupServiceStubSettings.newBuilder()); + } + + protected Builder(LookupServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LookupServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public LookupServiceStubSettings.Builder getStubSettingsBuilder() { + return ((LookupServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to resolveService. */ + public UnaryCallSettings.Builder + resolveServiceSettings() { + return getStubSettingsBuilder().resolveServiceSettings(); + } + + @Override + public LookupServiceSettings build() throws IOException { + return new LookupServiceSettings(this); + } + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java new file mode 100644 index 00000000..dde1622f --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java @@ -0,0 +1,2107 @@ +/* + * 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.servicedirectory.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.servicedirectory.v1beta1.stub.RegistrationServiceStub; +import com.google.cloud.servicedirectory.v1beta1.stub.RegistrationServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service Directory API for registering services. It defines the following + * resource model: + * + *

- The API has a collection of [Namespace][google.cloud.servicedirectory.v1beta1.Namespace] + * resources, named `projects/*/locations/*/namespaces/*`. + * + *

- Each Namespace has a collection of [Service][google.cloud.servicedirectory.v1beta1.Service] + * resources, named `projects/*/locations/*/namespaces/*/services/*`. + * + *

- Each Service has a collection of [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint] + * resources, named + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + *

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: + * + *

+ * 
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Namespace namespace = Namespace.newBuilder().build();
+ *   String namespaceId = "";
+ *   Namespace response = registrationServiceClient.createNamespace(parent, namespace, namespaceId);
+ * }
+ * 
+ * 
+ * + *

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

To customize credentials: + * + *

+ * 
+ * RegistrationServiceSettings registrationServiceSettings =
+ *     RegistrationServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegistrationServiceClient registrationServiceClient =
+ *     RegistrationServiceClient.create(registrationServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RegistrationServiceSettings registrationServiceSettings =
+ *     RegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegistrationServiceClient registrationServiceClient =
+ *     RegistrationServiceClient.create(registrationServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegistrationServiceClient implements BackgroundResource { + private final RegistrationServiceSettings settings; + private final RegistrationServiceStub stub; + + /** Constructs an instance of RegistrationServiceClient with default settings. */ + public static final RegistrationServiceClient create() throws IOException { + return create(RegistrationServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegistrationServiceClient, 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 RegistrationServiceClient create(RegistrationServiceSettings settings) + throws IOException { + return new RegistrationServiceClient(settings); + } + + /** + * Constructs an instance of RegistrationServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer to use RegistrationServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RegistrationServiceClient create(RegistrationServiceStub stub) { + return new RegistrationServiceClient(stub); + } + + /** + * Constructs an instance of RegistrationServiceClient, 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 RegistrationServiceClient(RegistrationServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((RegistrationServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RegistrationServiceClient(RegistrationServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegistrationServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegistrationServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a namespace, and returns the new Namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   String namespaceId = "";
+   *   Namespace response = registrationServiceClient.createNamespace(parent, namespace, namespaceId);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the project and location the namespace will be + * created in. + * @param namespace Required. A namespace with initial fields set. + * @param namespaceId Required. The Resource ID must be 1-63 characters long, and comply with + * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>. + * Specifically, the name must be 1-63 characters long and match the regular expression + * `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase + * letter, and all following characters must be a dash, lowercase letter, or digit, except the + * last character, which cannot be a dash. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Namespace createNamespace( + LocationName parent, Namespace namespace, String namespaceId) { + CreateNamespaceRequest request = + CreateNamespaceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setNamespace(namespace) + .setNamespaceId(namespaceId) + .build(); + return createNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a namespace, and returns the new Namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   String namespaceId = "";
+   *   Namespace response = registrationServiceClient.createNamespace(parent.toString(), namespace, namespaceId);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the project and location the namespace will be + * created in. + * @param namespace Required. A namespace with initial fields set. + * @param namespaceId Required. The Resource ID must be 1-63 characters long, and comply with + * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>. + * Specifically, the name must be 1-63 characters long and match the regular expression + * `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase + * letter, and all following characters must be a dash, lowercase letter, or digit, except the + * last character, which cannot be a dash. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Namespace createNamespace(String parent, Namespace namespace, String namespaceId) { + CreateNamespaceRequest request = + CreateNamespaceRequest.newBuilder() + .setParent(parent) + .setNamespace(namespace) + .setNamespaceId(namespaceId) + .build(); + return createNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a namespace, and returns the new Namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String namespaceId = "";
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   CreateNamespaceRequest request = CreateNamespaceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setNamespaceId(namespaceId)
+   *     .setNamespace(namespace)
+   *     .build();
+   *   Namespace response = registrationServiceClient.createNamespace(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 Namespace createNamespace(CreateNamespaceRequest request) { + return createNamespaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a namespace, and returns the new Namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String namespaceId = "";
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   CreateNamespaceRequest request = CreateNamespaceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setNamespaceId(namespaceId)
+   *     .setNamespace(namespace)
+   *     .build();
+   *   ApiFuture<Namespace> future = registrationServiceClient.createNamespaceCallable().futureCall(request);
+   *   // Do something
+   *   Namespace response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createNamespaceCallable() { + return stub.createNamespaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all namespaces. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Namespace element : registrationServiceClient.listNamespaces(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the project and location whose namespaces we'd + * like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNamespacesPagedResponse listNamespaces(LocationName parent) { + ListNamespacesRequest request = + ListNamespacesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listNamespaces(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all namespaces. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Namespace element : registrationServiceClient.listNamespaces(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the project and location whose namespaces we'd + * like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNamespacesPagedResponse listNamespaces(String parent) { + ListNamespacesRequest request = ListNamespacesRequest.newBuilder().setParent(parent).build(); + return listNamespaces(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all namespaces. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListNamespacesRequest request = ListNamespacesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Namespace element : registrationServiceClient.listNamespaces(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 ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest request) { + return listNamespacesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all namespaces. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListNamespacesRequest request = ListNamespacesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListNamespacesPagedResponse> future = registrationServiceClient.listNamespacesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Namespace element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listNamespacesPagedCallable() { + return stub.listNamespacesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all namespaces. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListNamespacesRequest request = ListNamespacesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListNamespacesResponse response = registrationServiceClient.listNamespacesCallable().call(request);
+   *     for (Namespace element : response.getNamespacesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listNamespacesCallable() { + return stub.listNamespacesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   Namespace response = registrationServiceClient.getNamespace(name);
+   * }
+   * 
+ * + * @param name Required. The name of the namespace to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Namespace getNamespace(NamespaceName name) { + GetNamespaceRequest request = + GetNamespaceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   Namespace response = registrationServiceClient.getNamespace(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the namespace to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Namespace getNamespace(String name) { + GetNamespaceRequest request = GetNamespaceRequest.newBuilder().setName(name).build(); + return getNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   GetNamespaceRequest request = GetNamespaceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Namespace response = registrationServiceClient.getNamespace(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 Namespace getNamespace(GetNamespaceRequest request) { + return getNamespaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   GetNamespaceRequest request = GetNamespaceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Namespace> future = registrationServiceClient.getNamespaceCallable().futureCall(request);
+   *   // Do something
+   *   Namespace response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getNamespaceCallable() { + return stub.getNamespaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Namespace response = registrationServiceClient.updateNamespace(namespace, updateMask);
+   * }
+   * 
+ * + * @param namespace Required. The updated namespace. + * @param updateMask Required. List of fields to be updated in this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Namespace updateNamespace(Namespace namespace, FieldMask updateMask) { + UpdateNamespaceRequest request = + UpdateNamespaceRequest.newBuilder() + .setNamespace(namespace) + .setUpdateMask(updateMask) + .build(); + return updateNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateNamespaceRequest request = UpdateNamespaceRequest.newBuilder()
+   *     .setNamespace(namespace)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Namespace response = registrationServiceClient.updateNamespace(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 Namespace updateNamespace(UpdateNamespaceRequest request) { + return updateNamespaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateNamespaceRequest request = UpdateNamespaceRequest.newBuilder()
+   *     .setNamespace(namespace)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Namespace> future = registrationServiceClient.updateNamespaceCallable().futureCall(request);
+   *   // Do something
+   *   Namespace response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateNamespaceCallable() { + return stub.updateNamespaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a namespace. This also deletes all services and endpoints in the namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   registrationServiceClient.deleteNamespace(name);
+   * }
+   * 
+ * + * @param name Required. The name of the namespace to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteNamespace(NamespaceName name) { + DeleteNamespaceRequest request = + DeleteNamespaceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a namespace. This also deletes all services and endpoints in the namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   registrationServiceClient.deleteNamespace(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the namespace to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteNamespace(String name) { + DeleteNamespaceRequest request = DeleteNamespaceRequest.newBuilder().setName(name).build(); + deleteNamespace(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a namespace. This also deletes all services and endpoints in the namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   DeleteNamespaceRequest request = DeleteNamespaceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   registrationServiceClient.deleteNamespace(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 void deleteNamespace(DeleteNamespaceRequest request) { + deleteNamespaceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a namespace. This also deletes all services and endpoints in the namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   DeleteNamespaceRequest request = DeleteNamespaceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = registrationServiceClient.deleteNamespaceCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteNamespaceCallable() { + return stub.deleteNamespaceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a service, and returns the new Service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   Service service = Service.newBuilder().build();
+   *   String serviceId = "";
+   *   Service response = registrationServiceClient.createService(parent, service, serviceId);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the namespace this service will belong to. + * @param service Required. A service with initial fields set. + * @param serviceId Required. The Resource ID must be 1-63 characters long, and comply with <a + * href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>. + * Specifically, the name must be 1-63 characters long and match the regular expression + * `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase + * letter, and all following characters must be a dash, lowercase letter, or digit, except the + * last character, which cannot be a dash. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service createService(NamespaceName parent, Service service, String serviceId) { + CreateServiceRequest request = + CreateServiceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setService(service) + .setServiceId(serviceId) + .build(); + return createService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a service, and returns the new Service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   Service service = Service.newBuilder().build();
+   *   String serviceId = "";
+   *   Service response = registrationServiceClient.createService(parent.toString(), service, serviceId);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the namespace this service will belong to. + * @param service Required. A service with initial fields set. + * @param serviceId Required. The Resource ID must be 1-63 characters long, and comply with <a + * href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>. + * Specifically, the name must be 1-63 characters long and match the regular expression + * `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase + * letter, and all following characters must be a dash, lowercase letter, or digit, except the + * last character, which cannot be a dash. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service createService(String parent, Service service, String serviceId) { + CreateServiceRequest request = + CreateServiceRequest.newBuilder() + .setParent(parent) + .setService(service) + .setServiceId(serviceId) + .build(); + return createService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a service, and returns the new Service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   String serviceId = "";
+   *   Service service = Service.newBuilder().build();
+   *   CreateServiceRequest request = CreateServiceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setServiceId(serviceId)
+   *     .setService(service)
+   *     .build();
+   *   Service response = registrationServiceClient.createService(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 Service createService(CreateServiceRequest request) { + return createServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a service, and returns the new Service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   String serviceId = "";
+   *   Service service = Service.newBuilder().build();
+   *   CreateServiceRequest request = CreateServiceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setServiceId(serviceId)
+   *     .setService(service)
+   *     .build();
+   *   ApiFuture<Service> future = registrationServiceClient.createServiceCallable().futureCall(request);
+   *   // Do something
+   *   Service response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createServiceCallable() { + return stub.createServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all services belonging to a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   for (Service element : registrationServiceClient.listServices(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the namespace whose services we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServicesPagedResponse listServices(NamespaceName parent) { + ListServicesRequest request = + ListServicesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all services belonging to a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   for (Service element : registrationServiceClient.listServices(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the namespace whose services we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListServicesPagedResponse listServices(String parent) { + ListServicesRequest request = ListServicesRequest.newBuilder().setParent(parent).build(); + return listServices(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all services belonging to a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   ListServicesRequest request = ListServicesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Service element : registrationServiceClient.listServices(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 ListServicesPagedResponse listServices(ListServicesRequest request) { + return listServicesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all services belonging to a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   ListServicesRequest request = ListServicesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListServicesPagedResponse> future = registrationServiceClient.listServicesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Service element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listServicesPagedCallable() { + return stub.listServicesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all services belonging to a namespace. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   ListServicesRequest request = ListServicesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListServicesResponse response = registrationServiceClient.listServicesCallable().call(request);
+   *     for (Service element : response.getServicesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listServicesCallable() { + return stub.listServicesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   Service response = registrationServiceClient.getService(name);
+   * }
+   * 
+ * + * @param name Required. The name of the service to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service getService(ServiceName name) { + GetServiceRequest request = + GetServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   Service response = registrationServiceClient.getService(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the service to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service getService(String name) { + GetServiceRequest request = GetServiceRequest.newBuilder().setName(name).build(); + return getService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   GetServiceRequest request = GetServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Service response = registrationServiceClient.getService(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 Service getService(GetServiceRequest request) { + return getServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   GetServiceRequest request = GetServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Service> future = registrationServiceClient.getServiceCallable().futureCall(request);
+   *   // Do something
+   *   Service response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getServiceCallable() { + return stub.getServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Service response = registrationServiceClient.updateService(service, updateMask);
+   * }
+   * 
+ * + * @param service Required. The updated service. + * @param updateMask Required. List of fields to be updated in this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Service updateService(Service service, FieldMask updateMask) { + UpdateServiceRequest request = + UpdateServiceRequest.newBuilder().setService(service).setUpdateMask(updateMask).build(); + return updateService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateServiceRequest request = UpdateServiceRequest.newBuilder()
+   *     .setService(service)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Service response = registrationServiceClient.updateService(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 Service updateService(UpdateServiceRequest request) { + return updateServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateServiceRequest request = UpdateServiceRequest.newBuilder()
+   *     .setService(service)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Service> future = registrationServiceClient.updateServiceCallable().futureCall(request);
+   *   // Do something
+   *   Service response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateServiceCallable() { + return stub.updateServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a service. This also deletes all endpoints associated with the service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   registrationServiceClient.deleteService(name);
+   * }
+   * 
+ * + * @param name Required. The name of the service to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(ServiceName name) { + DeleteServiceRequest request = + DeleteServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a service. This also deletes all endpoints associated with the service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   registrationServiceClient.deleteService(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the service to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(String name) { + DeleteServiceRequest request = DeleteServiceRequest.newBuilder().setName(name).build(); + deleteService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a service. This also deletes all endpoints associated with the service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   registrationServiceClient.deleteService(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 void deleteService(DeleteServiceRequest request) { + deleteServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a service. This also deletes all endpoints associated with the service. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = registrationServiceClient.deleteServiceCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteServiceCallable() { + return stub.deleteServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a endpoint, and returns the new Endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   String endpointId = "";
+   *   Endpoint response = registrationServiceClient.createEndpoint(parent, endpoint, endpointId);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the service that this endpoint provides. + * @param endpoint Required. A endpoint with initial fields set. + * @param endpointId Required. The Resource ID must be 1-63 characters long, and comply with <a + * href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>. + * Specifically, the name must be 1-63 characters long and match the regular expression + * `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase + * letter, and all following characters must be a dash, lowercase letter, or digit, except the + * last character, which cannot be a dash. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Endpoint createEndpoint(ServiceName parent, Endpoint endpoint, String endpointId) { + CreateEndpointRequest request = + CreateEndpointRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setEndpoint(endpoint) + .setEndpointId(endpointId) + .build(); + return createEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a endpoint, and returns the new Endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   String endpointId = "";
+   *   Endpoint response = registrationServiceClient.createEndpoint(parent.toString(), endpoint, endpointId);
+   * }
+   * 
+ * + * @param parent Required. The resource name of the service that this endpoint provides. + * @param endpoint Required. A endpoint with initial fields set. + * @param endpointId Required. The Resource ID must be 1-63 characters long, and comply with <a + * href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>. + * Specifically, the name must be 1-63 characters long and match the regular expression + * `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase + * letter, and all following characters must be a dash, lowercase letter, or digit, except the + * last character, which cannot be a dash. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Endpoint createEndpoint(String parent, Endpoint endpoint, String endpointId) { + CreateEndpointRequest request = + CreateEndpointRequest.newBuilder() + .setParent(parent) + .setEndpoint(endpoint) + .setEndpointId(endpointId) + .build(); + return createEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a endpoint, and returns the new Endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   String endpointId = "";
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   CreateEndpointRequest request = CreateEndpointRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEndpointId(endpointId)
+   *     .setEndpoint(endpoint)
+   *     .build();
+   *   Endpoint response = registrationServiceClient.createEndpoint(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 Endpoint createEndpoint(CreateEndpointRequest request) { + return createEndpointCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a endpoint, and returns the new Endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   String endpointId = "";
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   CreateEndpointRequest request = CreateEndpointRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setEndpointId(endpointId)
+   *     .setEndpoint(endpoint)
+   *     .build();
+   *   ApiFuture<Endpoint> future = registrationServiceClient.createEndpointCallable().futureCall(request);
+   *   // Do something
+   *   Endpoint response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createEndpointCallable() { + return stub.createEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all endpoints. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   for (Endpoint element : registrationServiceClient.listEndpoints(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the service whose endpoints we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEndpointsPagedResponse listEndpoints(ServiceName parent) { + ListEndpointsRequest request = + ListEndpointsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listEndpoints(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all endpoints. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   for (Endpoint element : registrationServiceClient.listEndpoints(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the service whose endpoints we'd like to list. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEndpointsPagedResponse listEndpoints(String parent) { + ListEndpointsRequest request = ListEndpointsRequest.newBuilder().setParent(parent).build(); + return listEndpoints(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all endpoints. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   ListEndpointsRequest request = ListEndpointsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Endpoint element : registrationServiceClient.listEndpoints(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 ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest request) { + return listEndpointsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all endpoints. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   ListEndpointsRequest request = ListEndpointsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListEndpointsPagedResponse> future = registrationServiceClient.listEndpointsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Endpoint element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listEndpointsPagedCallable() { + return stub.listEndpointsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all endpoints. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   ListEndpointsRequest request = ListEndpointsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListEndpointsResponse response = registrationServiceClient.listEndpointsCallable().call(request);
+   *     for (Endpoint element : response.getEndpointsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listEndpointsCallable() { + return stub.listEndpointsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   Endpoint response = registrationServiceClient.getEndpoint(name);
+   * }
+   * 
+ * + * @param name Required. The name of the endpoint to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Endpoint getEndpoint(EndpointName name) { + GetEndpointRequest request = + GetEndpointRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   Endpoint response = registrationServiceClient.getEndpoint(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the endpoint to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Endpoint getEndpoint(String name) { + GetEndpointRequest request = GetEndpointRequest.newBuilder().setName(name).build(); + return getEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   GetEndpointRequest request = GetEndpointRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Endpoint response = registrationServiceClient.getEndpoint(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 Endpoint getEndpoint(GetEndpointRequest request) { + return getEndpointCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   GetEndpointRequest request = GetEndpointRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Endpoint> future = registrationServiceClient.getEndpointCallable().futureCall(request);
+   *   // Do something
+   *   Endpoint response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getEndpointCallable() { + return stub.getEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Endpoint response = registrationServiceClient.updateEndpoint(endpoint, updateMask);
+   * }
+   * 
+ * + * @param endpoint Required. The updated endpoint. + * @param updateMask Required. List of fields to be updated in this request. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask) { + UpdateEndpointRequest request = + UpdateEndpointRequest.newBuilder().setEndpoint(endpoint).setUpdateMask(updateMask).build(); + return updateEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateEndpointRequest request = UpdateEndpointRequest.newBuilder()
+   *     .setEndpoint(endpoint)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   Endpoint response = registrationServiceClient.updateEndpoint(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 Endpoint updateEndpoint(UpdateEndpointRequest request) { + return updateEndpointCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   UpdateEndpointRequest request = UpdateEndpointRequest.newBuilder()
+   *     .setEndpoint(endpoint)
+   *     .setUpdateMask(updateMask)
+   *     .build();
+   *   ApiFuture<Endpoint> future = registrationServiceClient.updateEndpointCallable().futureCall(request);
+   *   // Do something
+   *   Endpoint response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateEndpointCallable() { + return stub.updateEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   registrationServiceClient.deleteEndpoint(name);
+   * }
+   * 
+ * + * @param name Required. The name of the endpoint to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteEndpoint(EndpointName name) { + DeleteEndpointRequest request = + DeleteEndpointRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   registrationServiceClient.deleteEndpoint(name.toString());
+   * }
+   * 
+ * + * @param name Required. The name of the endpoint to delete. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteEndpoint(String name) { + DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder().setName(name).build(); + deleteEndpoint(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   registrationServiceClient.deleteEndpoint(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 void deleteEndpoint(DeleteEndpointRequest request) { + deleteEndpointCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a endpoint. + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = registrationServiceClient.deleteEndpointCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteEndpointCallable() { + return stub.deleteEndpointCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the IAM Policy for a resource (namespace or service only). + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ResourceName resource = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = registrationServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the IAM Policy for a resource (namespace or service only). + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ResourceName resource = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = registrationServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the IAM Policy for a resource (namespace or service only). + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ResourceName resource = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = registrationServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the IAM Policy for a resource (namespace or service only). + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ResourceName resource = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = registrationServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Tests IAM permissions for a resource (namespace or service only). + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ResourceName resource = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = registrationServiceClient.testIamPermissions(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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Tests IAM permissions for a resource (namespace or service only). + * + *

Sample code: + * + *


+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ResourceName resource = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = registrationServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @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 ListNamespacesPagedResponse + extends AbstractPagedListResponse< + ListNamespacesRequest, + ListNamespacesResponse, + Namespace, + ListNamespacesPage, + ListNamespacesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNamespacesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNamespacesPagedResponse apply(ListNamespacesPage input) { + return new ListNamespacesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListNamespacesPagedResponse(ListNamespacesPage page) { + super(page, ListNamespacesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNamespacesPage + extends AbstractPage< + ListNamespacesRequest, ListNamespacesResponse, Namespace, ListNamespacesPage> { + + private ListNamespacesPage( + PageContext context, + ListNamespacesResponse response) { + super(context, response); + } + + private static ListNamespacesPage createEmptyPage() { + return new ListNamespacesPage(null, null); + } + + @Override + protected ListNamespacesPage createPage( + PageContext context, + ListNamespacesResponse response) { + return new ListNamespacesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNamespacesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNamespacesRequest, + ListNamespacesResponse, + Namespace, + ListNamespacesPage, + ListNamespacesFixedSizeCollection> { + + private ListNamespacesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNamespacesFixedSizeCollection createEmptyCollection() { + return new ListNamespacesFixedSizeCollection(null, 0); + } + + @Override + protected ListNamespacesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNamespacesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListServicesPagedResponse + extends AbstractPagedListResponse< + ListServicesRequest, + ListServicesResponse, + Service, + ListServicesPage, + ListServicesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListServicesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListServicesPagedResponse apply(ListServicesPage input) { + return new ListServicesPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListServicesPagedResponse(ListServicesPage page) { + super(page, ListServicesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListServicesPage + extends AbstractPage { + + private ListServicesPage( + PageContext context, + ListServicesResponse response) { + super(context, response); + } + + private static ListServicesPage createEmptyPage() { + return new ListServicesPage(null, null); + } + + @Override + protected ListServicesPage createPage( + PageContext context, + ListServicesResponse response) { + return new ListServicesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListServicesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListServicesRequest, + ListServicesResponse, + Service, + ListServicesPage, + ListServicesFixedSizeCollection> { + + private ListServicesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListServicesFixedSizeCollection createEmptyCollection() { + return new ListServicesFixedSizeCollection(null, 0); + } + + @Override + protected ListServicesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListServicesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListEndpointsPagedResponse + extends AbstractPagedListResponse< + ListEndpointsRequest, + ListEndpointsResponse, + Endpoint, + ListEndpointsPage, + ListEndpointsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEndpointsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListEndpointsPagedResponse apply(ListEndpointsPage input) { + return new ListEndpointsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListEndpointsPagedResponse(ListEndpointsPage page) { + super(page, ListEndpointsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEndpointsPage + extends AbstractPage< + ListEndpointsRequest, ListEndpointsResponse, Endpoint, ListEndpointsPage> { + + private ListEndpointsPage( + PageContext context, + ListEndpointsResponse response) { + super(context, response); + } + + private static ListEndpointsPage createEmptyPage() { + return new ListEndpointsPage(null, null); + } + + @Override + protected ListEndpointsPage createPage( + PageContext context, + ListEndpointsResponse response) { + return new ListEndpointsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEndpointsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEndpointsRequest, + ListEndpointsResponse, + Endpoint, + ListEndpointsPage, + ListEndpointsFixedSizeCollection> { + + private ListEndpointsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEndpointsFixedSizeCollection createEmptyCollection() { + return new ListEndpointsFixedSizeCollection(null, 0); + } + + @Override + protected ListEndpointsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEndpointsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceSettings.java new file mode 100644 index 00000000..6836536f --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceSettings.java @@ -0,0 +1,373 @@ +/* + * 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.servicedirectory.v1beta1; + +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListServicesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.servicedirectory.v1beta1.stub.RegistrationServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegistrationServiceClient}. + * + *

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

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

+ * 
+ * RegistrationServiceSettings.Builder registrationServiceSettingsBuilder =
+ *     RegistrationServiceSettings.newBuilder();
+ * registrationServiceSettingsBuilder
+ *     .createNamespaceSettings()
+ *     .setRetrySettings(
+ *         registrationServiceSettingsBuilder.createNamespaceSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RegistrationServiceSettings registrationServiceSettings = registrationServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegistrationServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createNamespace. */ + public UnaryCallSettings createNamespaceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).createNamespaceSettings(); + } + + /** Returns the object with the settings used for calls to listNamespaces. */ + public PagedCallSettings< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + listNamespacesSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).listNamespacesSettings(); + } + + /** Returns the object with the settings used for calls to getNamespace. */ + public UnaryCallSettings getNamespaceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).getNamespaceSettings(); + } + + /** Returns the object with the settings used for calls to updateNamespace. */ + public UnaryCallSettings updateNamespaceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).updateNamespaceSettings(); + } + + /** Returns the object with the settings used for calls to deleteNamespace. */ + public UnaryCallSettings deleteNamespaceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).deleteNamespaceSettings(); + } + + /** Returns the object with the settings used for calls to createService. */ + public UnaryCallSettings createServiceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).createServiceSettings(); + } + + /** Returns the object with the settings used for calls to listServices. */ + public PagedCallSettings + listServicesSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).listServicesSettings(); + } + + /** Returns the object with the settings used for calls to getService. */ + public UnaryCallSettings getServiceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).getServiceSettings(); + } + + /** Returns the object with the settings used for calls to updateService. */ + public UnaryCallSettings updateServiceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).updateServiceSettings(); + } + + /** Returns the object with the settings used for calls to deleteService. */ + public UnaryCallSettings deleteServiceSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).deleteServiceSettings(); + } + + /** Returns the object with the settings used for calls to createEndpoint. */ + public UnaryCallSettings createEndpointSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).createEndpointSettings(); + } + + /** Returns the object with the settings used for calls to listEndpoints. */ + public PagedCallSettings + listEndpointsSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).listEndpointsSettings(); + } + + /** Returns the object with the settings used for calls to getEndpoint. */ + public UnaryCallSettings getEndpointSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).getEndpointSettings(); + } + + /** Returns the object with the settings used for calls to updateEndpoint. */ + public UnaryCallSettings updateEndpointSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).updateEndpointSettings(); + } + + /** Returns the object with the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings deleteEndpointSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).deleteEndpointSettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((RegistrationServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final RegistrationServiceSettings create(RegistrationServiceStubSettings stub) + throws IOException { + return new RegistrationServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegistrationServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RegistrationServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RegistrationServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegistrationServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RegistrationServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegistrationServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegistrationServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegistrationServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RegistrationServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RegistrationServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RegistrationServiceStubSettings.newBuilder()); + } + + protected Builder(RegistrationServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegistrationServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public RegistrationServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RegistrationServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createNamespace. */ + public UnaryCallSettings.Builder createNamespaceSettings() { + return getStubSettingsBuilder().createNamespaceSettings(); + } + + /** Returns the builder for the settings used for calls to listNamespaces. */ + public PagedCallSettings.Builder< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + listNamespacesSettings() { + return getStubSettingsBuilder().listNamespacesSettings(); + } + + /** Returns the builder for the settings used for calls to getNamespace. */ + public UnaryCallSettings.Builder getNamespaceSettings() { + return getStubSettingsBuilder().getNamespaceSettings(); + } + + /** Returns the builder for the settings used for calls to updateNamespace. */ + public UnaryCallSettings.Builder updateNamespaceSettings() { + return getStubSettingsBuilder().updateNamespaceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNamespace. */ + public UnaryCallSettings.Builder deleteNamespaceSettings() { + return getStubSettingsBuilder().deleteNamespaceSettings(); + } + + /** Returns the builder for the settings used for calls to createService. */ + public UnaryCallSettings.Builder createServiceSettings() { + return getStubSettingsBuilder().createServiceSettings(); + } + + /** Returns the builder for the settings used for calls to listServices. */ + public PagedCallSettings.Builder< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings() { + return getStubSettingsBuilder().listServicesSettings(); + } + + /** Returns the builder for the settings used for calls to getService. */ + public UnaryCallSettings.Builder getServiceSettings() { + return getStubSettingsBuilder().getServiceSettings(); + } + + /** Returns the builder for the settings used for calls to updateService. */ + public UnaryCallSettings.Builder updateServiceSettings() { + return getStubSettingsBuilder().updateServiceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteService. */ + public UnaryCallSettings.Builder deleteServiceSettings() { + return getStubSettingsBuilder().deleteServiceSettings(); + } + + /** Returns the builder for the settings used for calls to createEndpoint. */ + public UnaryCallSettings.Builder createEndpointSettings() { + return getStubSettingsBuilder().createEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to listEndpoints. */ + public PagedCallSettings.Builder< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings() { + return getStubSettingsBuilder().listEndpointsSettings(); + } + + /** Returns the builder for the settings used for calls to getEndpoint. */ + public UnaryCallSettings.Builder getEndpointSettings() { + return getStubSettingsBuilder().getEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to updateEndpoint. */ + public UnaryCallSettings.Builder updateEndpointSettings() { + return getStubSettingsBuilder().updateEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings.Builder deleteEndpointSettings() { + return getStubSettingsBuilder().deleteEndpointSettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public RegistrationServiceSettings build() throws IOException { + return new RegistrationServiceSettings(this); + } + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java new file mode 100644 index 00000000..ea385ccd --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java @@ -0,0 +1,71 @@ +/* + * 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. + */ + +/** + * A client to Service Directory API. + * + *

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

=================== LookupServiceClient =================== + * + *

Service Description: Service Directory API for looking up service data at runtime. + * + *

Sample for LookupServiceClient: + * + *

+ * 
+ * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+ *   ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+ *   ResolveServiceRequest request = ResolveServiceRequest.newBuilder()
+ *     .setName(name.toString())
+ *     .build();
+ *   ResolveServiceResponse response = lookupServiceClient.resolveService(request);
+ * }
+ * 
+ * 
+ * + * ========================= RegistrationServiceClient ========================= + * + *

Service Description: Service Directory API for registering services. It defines the following + * resource model: + * + *

- The API has a collection of [Namespace][google.cloud.servicedirectory.v1beta1.Namespace] + * resources, named `projects/*/locations/*/namespaces/*`. + * + *

- Each Namespace has a collection of [Service][google.cloud.servicedirectory.v1beta1.Service] + * resources, named `projects/*/locations/*/namespaces/*/services/*`. + * + *

- Each Service has a collection of [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint] + * resources, named + * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. + * + *

Sample for RegistrationServiceClient: + * + *

+ * 
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Namespace namespace = Namespace.newBuilder().build();
+ *   String namespaceId = "";
+ *   Namespace response = registrationServiceClient.createNamespace(parent, namespace, namespaceId);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.servicedirectory.v1beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceCallableFactory.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceCallableFactory.java new file mode 100644 index 00000000..11c834dc --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Service Directory API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcLookupServiceCallableFactory 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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java new file mode 100644 index 00000000..49fd5f7e --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java @@ -0,0 +1,156 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse; +import com.google.common.collect.ImmutableMap; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Service Directory API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcLookupServiceStub extends LookupServiceStub { + + private static final MethodDescriptor + resolveServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.LookupService/ResolveService") + .setRequestMarshaller( + ProtoUtils.marshaller(ResolveServiceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ResolveServiceResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable resolveServiceCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcLookupServiceStub create(LookupServiceStubSettings settings) + throws IOException { + return new GrpcLookupServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcLookupServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcLookupServiceStub(LookupServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcLookupServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcLookupServiceStub( + LookupServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcLookupServiceStub, 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 GrpcLookupServiceStub(LookupServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcLookupServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcLookupServiceStub, 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 GrpcLookupServiceStub( + LookupServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + resolveServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resolveServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ResolveServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.resolveServiceCallable = + callableFactory.createUnaryCallable( + resolveServiceTransportSettings, settings.resolveServiceSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable resolveServiceCallable() { + return resolveServiceCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceCallableFactory.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceCallableFactory.java new file mode 100644 index 00000000..d5dc37d5 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Service Directory API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcRegistrationServiceCallableFactory 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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java new file mode 100644 index 00000000..8c779a73 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java @@ -0,0 +1,738 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListServicesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.Endpoint; +import com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.GetServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest; +import com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse; +import com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest; +import com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse; +import com.google.cloud.servicedirectory.v1beta1.ListServicesRequest; +import com.google.cloud.servicedirectory.v1beta1.ListServicesResponse; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.Service; +import com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Service Directory API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcRegistrationServiceStub extends RegistrationServiceStub { + + private static final MethodDescriptor + createNamespaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/CreateNamespace") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateNamespaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Namespace.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listNamespacesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/ListNamespaces") + .setRequestMarshaller( + ProtoUtils.marshaller(ListNamespacesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListNamespacesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getNamespaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/GetNamespace") + .setRequestMarshaller(ProtoUtils.marshaller(GetNamespaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Namespace.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateNamespaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateNamespace") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateNamespaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Namespace.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteNamespaceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteNamespace") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteNamespaceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/CreateService") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listServicesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/ListServices") + .setRequestMarshaller(ProtoUtils.marshaller(ListServicesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListServicesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.servicedirectory.v1beta1.RegistrationService/GetService") + .setRequestMarshaller(ProtoUtils.marshaller(GetServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateService") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteServiceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteService") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteServiceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/CreateEndpoint") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listEndpointsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/ListEndpoints") + .setRequestMarshaller( + ProtoUtils.marshaller(ListEndpointsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListEndpointsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/GetEndpoint") + .setRequestMarshaller(ProtoUtils.marshaller(GetEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateEndpoint") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteEndpointMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteEndpoint") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteEndpointRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.servicedirectory.v1beta1.RegistrationService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createNamespaceCallable; + private final UnaryCallable listNamespacesCallable; + private final UnaryCallable + listNamespacesPagedCallable; + private final UnaryCallable getNamespaceCallable; + private final UnaryCallable updateNamespaceCallable; + private final UnaryCallable deleteNamespaceCallable; + private final UnaryCallable createServiceCallable; + private final UnaryCallable listServicesCallable; + private final UnaryCallable + listServicesPagedCallable; + private final UnaryCallable getServiceCallable; + private final UnaryCallable updateServiceCallable; + private final UnaryCallable deleteServiceCallable; + private final UnaryCallable createEndpointCallable; + private final UnaryCallable listEndpointsCallable; + private final UnaryCallable + listEndpointsPagedCallable; + private final UnaryCallable getEndpointCallable; + private final UnaryCallable updateEndpointCallable; + private final UnaryCallable deleteEndpointCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRegistrationServiceStub create(RegistrationServiceStubSettings settings) + throws IOException { + return new GrpcRegistrationServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRegistrationServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcRegistrationServiceStub( + RegistrationServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRegistrationServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRegistrationServiceStub( + RegistrationServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRegistrationServiceStub, 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 GrpcRegistrationServiceStub( + RegistrationServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcRegistrationServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcRegistrationServiceStub, 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 GrpcRegistrationServiceStub( + RegistrationServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createNamespaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createNamespaceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateNamespaceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listNamespacesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listNamespacesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListNamespacesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getNamespaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getNamespaceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetNamespaceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateNamespaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateNamespaceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateNamespaceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("namespace.name", String.valueOf(request.getNamespace().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteNamespaceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNamespaceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteNamespaceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listServicesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listServicesMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListServicesRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("service.name", String.valueOf(request.getService().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteServiceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteServiceMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteServiceRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createEndpointMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateEndpointRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listEndpointsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEndpointsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListEndpointsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEndpointMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetEndpointRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateEndpointMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateEndpointRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("endpoint.name", String.valueOf(request.getEndpoint().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteEndpointTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteEndpointMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteEndpointRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.createNamespaceCallable = + callableFactory.createUnaryCallable( + createNamespaceTransportSettings, settings.createNamespaceSettings(), clientContext); + this.listNamespacesCallable = + callableFactory.createUnaryCallable( + listNamespacesTransportSettings, settings.listNamespacesSettings(), clientContext); + this.listNamespacesPagedCallable = + callableFactory.createPagedCallable( + listNamespacesTransportSettings, settings.listNamespacesSettings(), clientContext); + this.getNamespaceCallable = + callableFactory.createUnaryCallable( + getNamespaceTransportSettings, settings.getNamespaceSettings(), clientContext); + this.updateNamespaceCallable = + callableFactory.createUnaryCallable( + updateNamespaceTransportSettings, settings.updateNamespaceSettings(), clientContext); + this.deleteNamespaceCallable = + callableFactory.createUnaryCallable( + deleteNamespaceTransportSettings, settings.deleteNamespaceSettings(), clientContext); + this.createServiceCallable = + callableFactory.createUnaryCallable( + createServiceTransportSettings, settings.createServiceSettings(), clientContext); + this.listServicesCallable = + callableFactory.createUnaryCallable( + listServicesTransportSettings, settings.listServicesSettings(), clientContext); + this.listServicesPagedCallable = + callableFactory.createPagedCallable( + listServicesTransportSettings, settings.listServicesSettings(), clientContext); + this.getServiceCallable = + callableFactory.createUnaryCallable( + getServiceTransportSettings, settings.getServiceSettings(), clientContext); + this.updateServiceCallable = + callableFactory.createUnaryCallable( + updateServiceTransportSettings, settings.updateServiceSettings(), clientContext); + this.deleteServiceCallable = + callableFactory.createUnaryCallable( + deleteServiceTransportSettings, settings.deleteServiceSettings(), clientContext); + this.createEndpointCallable = + callableFactory.createUnaryCallable( + createEndpointTransportSettings, settings.createEndpointSettings(), clientContext); + this.listEndpointsCallable = + callableFactory.createUnaryCallable( + listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext); + this.listEndpointsPagedCallable = + callableFactory.createPagedCallable( + listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext); + this.getEndpointCallable = + callableFactory.createUnaryCallable( + getEndpointTransportSettings, settings.getEndpointSettings(), clientContext); + this.updateEndpointCallable = + callableFactory.createUnaryCallable( + updateEndpointTransportSettings, settings.updateEndpointSettings(), clientContext); + this.deleteEndpointCallable = + callableFactory.createUnaryCallable( + deleteEndpointTransportSettings, settings.deleteEndpointSettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createNamespaceCallable() { + return createNamespaceCallable; + } + + public UnaryCallable + listNamespacesPagedCallable() { + return listNamespacesPagedCallable; + } + + public UnaryCallable listNamespacesCallable() { + return listNamespacesCallable; + } + + public UnaryCallable getNamespaceCallable() { + return getNamespaceCallable; + } + + public UnaryCallable updateNamespaceCallable() { + return updateNamespaceCallable; + } + + public UnaryCallable deleteNamespaceCallable() { + return deleteNamespaceCallable; + } + + public UnaryCallable createServiceCallable() { + return createServiceCallable; + } + + public UnaryCallable listServicesPagedCallable() { + return listServicesPagedCallable; + } + + public UnaryCallable listServicesCallable() { + return listServicesCallable; + } + + public UnaryCallable getServiceCallable() { + return getServiceCallable; + } + + public UnaryCallable updateServiceCallable() { + return updateServiceCallable; + } + + public UnaryCallable deleteServiceCallable() { + return deleteServiceCallable; + } + + public UnaryCallable createEndpointCallable() { + return createEndpointCallable; + } + + public UnaryCallable + listEndpointsPagedCallable() { + return listEndpointsPagedCallable; + } + + public UnaryCallable listEndpointsCallable() { + return listEndpointsCallable; + } + + public UnaryCallable getEndpointCallable() { + return getEndpointCallable; + } + + public UnaryCallable updateEndpointCallable() { + return updateEndpointCallable; + } + + public UnaryCallable deleteEndpointCallable() { + return deleteEndpointCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStub.java new file mode 100644 index 00000000..0cb813af --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStub.java @@ -0,0 +1,41 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Service Directory API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class LookupServiceStub implements BackgroundResource { + + public UnaryCallable resolveServiceCallable() { + throw new UnsupportedOperationException("Not implemented: resolveServiceCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStubSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStubSettings.java new file mode 100644 index 00000000..6be148e4 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStubSettings.java @@ -0,0 +1,274 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import com.google.api.core.ApiFunction; +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.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +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.cloud.servicedirectory.v1beta1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse; +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 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 LookupServiceStub}. + * + *

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

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

+ * 
+ * LookupServiceStubSettings.Builder lookupServiceSettingsBuilder =
+ *     LookupServiceStubSettings.newBuilder();
+ * lookupServiceSettingsBuilder
+ *     .resolveServiceSettings()
+ *     .setRetrySettings(
+ *         lookupServiceSettingsBuilder.resolveServiceSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LookupServiceStubSettings lookupServiceSettings = lookupServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class LookupServiceStubSettings 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 + resolveServiceSettings; + + /** Returns the object with the settings used for calls to resolveService. */ + public UnaryCallSettings resolveServiceSettings() { + return resolveServiceSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public LookupServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcLookupServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + 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 "servicedirectory.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LookupServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LookupServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + resolveServiceSettings = settingsBuilder.resolveServiceSettings().build(); + } + + /** Builder for LookupServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + resolveServiceSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + resolveServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(resolveServiceSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .resolveServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(LookupServiceStubSettings settings) { + super(settings); + + resolveServiceSettings = settings.resolveServiceSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(resolveServiceSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to resolveService. */ + public UnaryCallSettings.Builder + resolveServiceSettings() { + return resolveServiceSettings; + } + + @Override + public LookupServiceStubSettings build() throws IOException { + return new LookupServiceStubSettings(this); + } + } +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStub.java new file mode 100644 index 00000000..aa6d0227 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStub.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. + */ +package com.google.cloud.servicedirectory.v1beta1.stub; + +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListServicesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.Endpoint; +import com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.GetServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest; +import com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse; +import com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest; +import com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse; +import com.google.cloud.servicedirectory.v1beta1.ListServicesRequest; +import com.google.cloud.servicedirectory.v1beta1.ListServicesResponse; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.Service; +import com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Service Directory API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RegistrationServiceStub implements BackgroundResource { + + public UnaryCallable createNamespaceCallable() { + throw new UnsupportedOperationException("Not implemented: createNamespaceCallable()"); + } + + public UnaryCallable + listNamespacesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNamespacesPagedCallable()"); + } + + public UnaryCallable listNamespacesCallable() { + throw new UnsupportedOperationException("Not implemented: listNamespacesCallable()"); + } + + public UnaryCallable getNamespaceCallable() { + throw new UnsupportedOperationException("Not implemented: getNamespaceCallable()"); + } + + public UnaryCallable updateNamespaceCallable() { + throw new UnsupportedOperationException("Not implemented: updateNamespaceCallable()"); + } + + public UnaryCallable deleteNamespaceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNamespaceCallable()"); + } + + public UnaryCallable createServiceCallable() { + throw new UnsupportedOperationException("Not implemented: createServiceCallable()"); + } + + public UnaryCallable listServicesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listServicesPagedCallable()"); + } + + public UnaryCallable listServicesCallable() { + throw new UnsupportedOperationException("Not implemented: listServicesCallable()"); + } + + public UnaryCallable getServiceCallable() { + throw new UnsupportedOperationException("Not implemented: getServiceCallable()"); + } + + public UnaryCallable updateServiceCallable() { + throw new UnsupportedOperationException("Not implemented: updateServiceCallable()"); + } + + public UnaryCallable deleteServiceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteServiceCallable()"); + } + + public UnaryCallable createEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: createEndpointCallable()"); + } + + public UnaryCallable + listEndpointsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEndpointsPagedCallable()"); + } + + public UnaryCallable listEndpointsCallable() { + throw new UnsupportedOperationException("Not implemented: listEndpointsCallable()"); + } + + public UnaryCallable getEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: getEndpointCallable()"); + } + + public UnaryCallable updateEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: updateEndpointCallable()"); + } + + public UnaryCallable deleteEndpointCallable() { + throw new UnsupportedOperationException("Not implemented: deleteEndpointCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStubSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStubSettings.java new file mode 100644 index 00000000..9e82f269 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStubSettings.java @@ -0,0 +1,889 @@ +/* + * 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.servicedirectory.v1beta1.stub; + +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListServicesPagedResponse; + +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.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.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.servicedirectory.v1beta1.CreateEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.Endpoint; +import com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.GetServiceRequest; +import com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest; +import com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse; +import com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest; +import com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse; +import com.google.cloud.servicedirectory.v1beta1.ListServicesRequest; +import com.google.cloud.servicedirectory.v1beta1.ListServicesResponse; +import com.google.cloud.servicedirectory.v1beta1.Namespace; +import com.google.cloud.servicedirectory.v1beta1.Service; +import com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest; +import com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest; +import com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RegistrationServiceStub}. + * + *

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

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

+ * 
+ * RegistrationServiceStubSettings.Builder registrationServiceSettingsBuilder =
+ *     RegistrationServiceStubSettings.newBuilder();
+ * registrationServiceSettingsBuilder
+ *     .createNamespaceSettings()
+ *     .setRetrySettings(
+ *         registrationServiceSettingsBuilder.createNamespaceSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RegistrationServiceStubSettings registrationServiceSettings = registrationServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RegistrationServiceStubSettings 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 createNamespaceSettings; + private final PagedCallSettings< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + listNamespacesSettings; + private final UnaryCallSettings getNamespaceSettings; + private final UnaryCallSettings updateNamespaceSettings; + private final UnaryCallSettings deleteNamespaceSettings; + private final UnaryCallSettings createServiceSettings; + private final PagedCallSettings< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings; + private final UnaryCallSettings getServiceSettings; + private final UnaryCallSettings updateServiceSettings; + private final UnaryCallSettings deleteServiceSettings; + private final UnaryCallSettings createEndpointSettings; + private final PagedCallSettings< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings; + private final UnaryCallSettings getEndpointSettings; + private final UnaryCallSettings updateEndpointSettings; + private final UnaryCallSettings deleteEndpointSettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + /** Returns the object with the settings used for calls to createNamespace. */ + public UnaryCallSettings createNamespaceSettings() { + return createNamespaceSettings; + } + + /** Returns the object with the settings used for calls to listNamespaces. */ + public PagedCallSettings< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + listNamespacesSettings() { + return listNamespacesSettings; + } + + /** Returns the object with the settings used for calls to getNamespace. */ + public UnaryCallSettings getNamespaceSettings() { + return getNamespaceSettings; + } + + /** Returns the object with the settings used for calls to updateNamespace. */ + public UnaryCallSettings updateNamespaceSettings() { + return updateNamespaceSettings; + } + + /** Returns the object with the settings used for calls to deleteNamespace. */ + public UnaryCallSettings deleteNamespaceSettings() { + return deleteNamespaceSettings; + } + + /** Returns the object with the settings used for calls to createService. */ + public UnaryCallSettings createServiceSettings() { + return createServiceSettings; + } + + /** Returns the object with the settings used for calls to listServices. */ + public PagedCallSettings + listServicesSettings() { + return listServicesSettings; + } + + /** Returns the object with the settings used for calls to getService. */ + public UnaryCallSettings getServiceSettings() { + return getServiceSettings; + } + + /** Returns the object with the settings used for calls to updateService. */ + public UnaryCallSettings updateServiceSettings() { + return updateServiceSettings; + } + + /** Returns the object with the settings used for calls to deleteService. */ + public UnaryCallSettings deleteServiceSettings() { + return deleteServiceSettings; + } + + /** Returns the object with the settings used for calls to createEndpoint. */ + public UnaryCallSettings createEndpointSettings() { + return createEndpointSettings; + } + + /** Returns the object with the settings used for calls to listEndpoints. */ + public PagedCallSettings + listEndpointsSettings() { + return listEndpointsSettings; + } + + /** Returns the object with the settings used for calls to getEndpoint. */ + public UnaryCallSettings getEndpointSettings() { + return getEndpointSettings; + } + + /** Returns the object with the settings used for calls to updateEndpoint. */ + public UnaryCallSettings updateEndpointSettings() { + return updateEndpointSettings; + } + + /** Returns the object with the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings deleteEndpointSettings() { + return deleteEndpointSettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RegistrationServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRegistrationServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + 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 "servicedirectory.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RegistrationServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegistrationServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createNamespaceSettings = settingsBuilder.createNamespaceSettings().build(); + listNamespacesSettings = settingsBuilder.listNamespacesSettings().build(); + getNamespaceSettings = settingsBuilder.getNamespaceSettings().build(); + updateNamespaceSettings = settingsBuilder.updateNamespaceSettings().build(); + deleteNamespaceSettings = settingsBuilder.deleteNamespaceSettings().build(); + createServiceSettings = settingsBuilder.createServiceSettings().build(); + listServicesSettings = settingsBuilder.listServicesSettings().build(); + getServiceSettings = settingsBuilder.getServiceSettings().build(); + updateServiceSettings = settingsBuilder.updateServiceSettings().build(); + deleteServiceSettings = settingsBuilder.deleteServiceSettings().build(); + createEndpointSettings = settingsBuilder.createEndpointSettings().build(); + listEndpointsSettings = settingsBuilder.listEndpointsSettings().build(); + getEndpointSettings = settingsBuilder.getEndpointSettings().build(); + updateEndpointSettings = settingsBuilder.updateEndpointSettings().build(); + deleteEndpointSettings = settingsBuilder.deleteEndpointSettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + private static final PagedListDescriptor + LIST_NAMESPACES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNamespacesRequest injectToken(ListNamespacesRequest payload, String token) { + return ListNamespacesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNamespacesRequest injectPageSize( + ListNamespacesRequest payload, int pageSize) { + return ListNamespacesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNamespacesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNamespacesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListNamespacesResponse payload) { + return payload.getNamespacesList() != null + ? payload.getNamespacesList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_SERVICES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListServicesRequest injectToken(ListServicesRequest payload, String token) { + return ListServicesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListServicesRequest injectPageSize(ListServicesRequest payload, int pageSize) { + return ListServicesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListServicesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListServicesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListServicesResponse payload) { + return payload.getServicesList() != null + ? payload.getServicesList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_ENDPOINTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEndpointsRequest injectToken(ListEndpointsRequest payload, String token) { + return ListEndpointsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEndpointsRequest injectPageSize(ListEndpointsRequest payload, int pageSize) { + return ListEndpointsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEndpointsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEndpointsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEndpointsResponse payload) { + return payload.getEndpointsList() != null + ? payload.getEndpointsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + LIST_NAMESPACES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNamespacesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NAMESPACES_PAGE_STR_DESC, request, context); + return ListNamespacesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + LIST_SERVICES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListServicesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SERVICES_PAGE_STR_DESC, request, context); + return ListServicesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + LIST_ENDPOINTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEndpointsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ENDPOINTS_PAGE_STR_DESC, request, context); + return ListEndpointsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for RegistrationServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createNamespaceSettings; + private final PagedCallSettings.Builder< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + listNamespacesSettings; + private final UnaryCallSettings.Builder getNamespaceSettings; + private final UnaryCallSettings.Builder + updateNamespaceSettings; + private final UnaryCallSettings.Builder deleteNamespaceSettings; + private final UnaryCallSettings.Builder createServiceSettings; + private final PagedCallSettings.Builder< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings; + private final UnaryCallSettings.Builder getServiceSettings; + private final UnaryCallSettings.Builder updateServiceSettings; + private final UnaryCallSettings.Builder deleteServiceSettings; + private final UnaryCallSettings.Builder createEndpointSettings; + private final PagedCallSettings.Builder< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings; + private final UnaryCallSettings.Builder getEndpointSettings; + private final UnaryCallSettings.Builder updateEndpointSettings; + private final UnaryCallSettings.Builder deleteEndpointSettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createNamespaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNamespacesSettings = PagedCallSettings.newBuilder(LIST_NAMESPACES_PAGE_STR_FACT); + + getNamespaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateNamespaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteNamespaceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listServicesSettings = PagedCallSettings.newBuilder(LIST_SERVICES_PAGE_STR_FACT); + + getServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listEndpointsSettings = PagedCallSettings.newBuilder(LIST_ENDPOINTS_PAGE_STR_FACT); + + getEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteEndpointSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createNamespaceSettings, + listNamespacesSettings, + getNamespaceSettings, + updateNamespaceSettings, + deleteNamespaceSettings, + createServiceSettings, + listServicesSettings, + getServiceSettings, + updateServiceSettings, + deleteServiceSettings, + createEndpointSettings, + listEndpointsSettings, + getEndpointSettings, + updateEndpointSettings, + deleteEndpointSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNamespacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listServicesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listEndpointsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RegistrationServiceStubSettings settings) { + super(settings); + + createNamespaceSettings = settings.createNamespaceSettings.toBuilder(); + listNamespacesSettings = settings.listNamespacesSettings.toBuilder(); + getNamespaceSettings = settings.getNamespaceSettings.toBuilder(); + updateNamespaceSettings = settings.updateNamespaceSettings.toBuilder(); + deleteNamespaceSettings = settings.deleteNamespaceSettings.toBuilder(); + createServiceSettings = settings.createServiceSettings.toBuilder(); + listServicesSettings = settings.listServicesSettings.toBuilder(); + getServiceSettings = settings.getServiceSettings.toBuilder(); + updateServiceSettings = settings.updateServiceSettings.toBuilder(); + deleteServiceSettings = settings.deleteServiceSettings.toBuilder(); + createEndpointSettings = settings.createEndpointSettings.toBuilder(); + listEndpointsSettings = settings.listEndpointsSettings.toBuilder(); + getEndpointSettings = settings.getEndpointSettings.toBuilder(); + updateEndpointSettings = settings.updateEndpointSettings.toBuilder(); + deleteEndpointSettings = settings.deleteEndpointSettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createNamespaceSettings, + listNamespacesSettings, + getNamespaceSettings, + updateNamespaceSettings, + deleteNamespaceSettings, + createServiceSettings, + listServicesSettings, + getServiceSettings, + updateServiceSettings, + deleteServiceSettings, + createEndpointSettings, + listEndpointsSettings, + getEndpointSettings, + updateEndpointSettings, + deleteEndpointSettings, + getIamPolicySettings, + setIamPolicySettings, + testIamPermissionsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createNamespace. */ + public UnaryCallSettings.Builder createNamespaceSettings() { + return createNamespaceSettings; + } + + /** Returns the builder for the settings used for calls to listNamespaces. */ + public PagedCallSettings.Builder< + ListNamespacesRequest, ListNamespacesResponse, ListNamespacesPagedResponse> + listNamespacesSettings() { + return listNamespacesSettings; + } + + /** Returns the builder for the settings used for calls to getNamespace. */ + public UnaryCallSettings.Builder getNamespaceSettings() { + return getNamespaceSettings; + } + + /** Returns the builder for the settings used for calls to updateNamespace. */ + public UnaryCallSettings.Builder updateNamespaceSettings() { + return updateNamespaceSettings; + } + + /** Returns the builder for the settings used for calls to deleteNamespace. */ + public UnaryCallSettings.Builder deleteNamespaceSettings() { + return deleteNamespaceSettings; + } + + /** Returns the builder for the settings used for calls to createService. */ + public UnaryCallSettings.Builder createServiceSettings() { + return createServiceSettings; + } + + /** Returns the builder for the settings used for calls to listServices. */ + public PagedCallSettings.Builder< + ListServicesRequest, ListServicesResponse, ListServicesPagedResponse> + listServicesSettings() { + return listServicesSettings; + } + + /** Returns the builder for the settings used for calls to getService. */ + public UnaryCallSettings.Builder getServiceSettings() { + return getServiceSettings; + } + + /** Returns the builder for the settings used for calls to updateService. */ + public UnaryCallSettings.Builder updateServiceSettings() { + return updateServiceSettings; + } + + /** Returns the builder for the settings used for calls to deleteService. */ + public UnaryCallSettings.Builder deleteServiceSettings() { + return deleteServiceSettings; + } + + /** Returns the builder for the settings used for calls to createEndpoint. */ + public UnaryCallSettings.Builder createEndpointSettings() { + return createEndpointSettings; + } + + /** Returns the builder for the settings used for calls to listEndpoints. */ + public PagedCallSettings.Builder< + ListEndpointsRequest, ListEndpointsResponse, ListEndpointsPagedResponse> + listEndpointsSettings() { + return listEndpointsSettings; + } + + /** Returns the builder for the settings used for calls to getEndpoint. */ + public UnaryCallSettings.Builder getEndpointSettings() { + return getEndpointSettings; + } + + /** Returns the builder for the settings used for calls to updateEndpoint. */ + public UnaryCallSettings.Builder updateEndpointSettings() { + return updateEndpointSettings; + } + + /** Returns the builder for the settings used for calls to deleteEndpoint. */ + public UnaryCallSettings.Builder deleteEndpointSettings() { + return deleteEndpointSettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public RegistrationServiceStubSettings build() throws IOException { + return new RegistrationServiceStubSettings(this); + } + } +} diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClientTest.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClientTest.java new file mode 100644 index 00000000..78928e61 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClientTest.java @@ -0,0 +1,121 @@ +/* + * 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.servicedirectory.v1beta1; + +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.protobuf.AbstractMessage; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class LookupServiceClientTest { + private static MockLookupService mockLookupService; + private static MockRegistrationService mockRegistrationService; + private static MockServiceHelper serviceHelper; + private LookupServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockLookupService = new MockLookupService(); + mockRegistrationService = new MockRegistrationService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockLookupService, mockRegistrationService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + LookupServiceSettings settings = + LookupServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LookupServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void resolveServiceTest() { + ResolveServiceResponse expectedResponse = ResolveServiceResponse.newBuilder().build(); + mockLookupService.addResponse(expectedResponse); + + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + ResolveServiceRequest request = + ResolveServiceRequest.newBuilder().setName(name.toString()).build(); + + ResolveServiceResponse actualResponse = client.resolveService(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLookupService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResolveServiceRequest actualRequest = (ResolveServiceRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void resolveServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockLookupService.addException(exception); + + try { + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + ResolveServiceRequest request = + ResolveServiceRequest.newBuilder().setName(name.toString()).build(); + + client.resolveService(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupService.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupService.java new file mode 100644 index 00000000..e5500e03 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupService.java @@ -0,0 +1,57 @@ +/* + * 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.servicedirectory.v1beta1; + +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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockLookupService implements MockGrpcService { + private final MockLookupServiceImpl serviceImpl; + + public MockLookupService() { + serviceImpl = new MockLookupServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java new file mode 100644 index 00000000..9dd641cf --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java @@ -0,0 +1,73 @@ +/* + * 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.servicedirectory.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.servicedirectory.v1beta1.LookupServiceGrpc.LookupServiceImplBase; +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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockLookupServiceImpl extends LookupServiceImplBase { + private List requests; + private Queue responses; + + public MockLookupServiceImpl() { + 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 resolveService( + ResolveServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ResolveServiceResponse) { + requests.add(request); + responseObserver.onNext((ResolveServiceResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationService.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationService.java new file mode 100644 index 00000000..2e27f40b --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationService.java @@ -0,0 +1,57 @@ +/* + * 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.servicedirectory.v1beta1; + +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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockRegistrationService implements MockGrpcService { + private final MockRegistrationServiceImpl serviceImpl; + + public MockRegistrationService() { + serviceImpl = new MockRegistrationServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java new file mode 100644 index 00000000..0834412a --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java @@ -0,0 +1,330 @@ +/* + * 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.servicedirectory.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.servicedirectory.v1beta1.RegistrationServiceGrpc.RegistrationServiceImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockRegistrationServiceImpl extends RegistrationServiceImplBase { + private List requests; + private Queue responses; + + public MockRegistrationServiceImpl() { + 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 createNamespace( + CreateNamespaceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Namespace) { + requests.add(request); + responseObserver.onNext((Namespace) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listNamespaces( + ListNamespacesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListNamespacesResponse) { + requests.add(request); + responseObserver.onNext((ListNamespacesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getNamespace( + GetNamespaceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Namespace) { + requests.add(request); + responseObserver.onNext((Namespace) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateNamespace( + UpdateNamespaceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Namespace) { + requests.add(request); + responseObserver.onNext((Namespace) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteNamespace( + DeleteNamespaceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createService( + CreateServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Service) { + requests.add(request); + responseObserver.onNext((Service) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listServices( + ListServicesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListServicesResponse) { + requests.add(request); + responseObserver.onNext((ListServicesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getService(GetServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Service) { + requests.add(request); + responseObserver.onNext((Service) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateService( + UpdateServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Service) { + requests.add(request); + responseObserver.onNext((Service) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteService(DeleteServiceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createEndpoint( + CreateEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Endpoint) { + requests.add(request); + responseObserver.onNext((Endpoint) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listEndpoints( + ListEndpointsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListEndpointsResponse) { + requests.add(request); + responseObserver.onNext((ListEndpointsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getEndpoint(GetEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Endpoint) { + requests.add(request); + responseObserver.onNext((Endpoint) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateEndpoint( + UpdateEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Endpoint) { + requests.add(request); + responseObserver.onNext((Endpoint) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteEndpoint( + DeleteEndpointRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClientTest.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClientTest.java new file mode 100644 index 00000000..b5d653e6 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClientTest.java @@ -0,0 +1,895 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.servicedirectory.v1beta1; + +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListServicesPagedResponse; + +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.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RegistrationServiceClientTest { + private static MockLookupService mockLookupService; + private static MockRegistrationService mockRegistrationService; + private static MockServiceHelper serviceHelper; + private RegistrationServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockLookupService = new MockLookupService(); + mockRegistrationService = new MockRegistrationService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockLookupService, mockRegistrationService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + RegistrationServiceSettings settings = + RegistrationServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegistrationServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createNamespaceTest() { + NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + Namespace expectedResponse = Namespace.newBuilder().setName(name.toString()).build(); + mockRegistrationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Namespace namespace = Namespace.newBuilder().build(); + String namespaceId = "namespaceId-1253352833"; + + Namespace actualResponse = client.createNamespace(parent, namespace, namespaceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNamespaceRequest actualRequest = (CreateNamespaceRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(namespace, actualRequest.getNamespace()); + Assert.assertEquals(namespaceId, actualRequest.getNamespaceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createNamespaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Namespace namespace = Namespace.newBuilder().build(); + String namespaceId = "namespaceId-1253352833"; + + client.createNamespace(parent, namespace, namespaceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNamespacesTest() { + String nextPageToken = ""; + Namespace namespacesElement = Namespace.newBuilder().build(); + List namespaces = Arrays.asList(namespacesElement); + ListNamespacesResponse expectedResponse = + ListNamespacesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllNamespaces(namespaces) + .build(); + mockRegistrationService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListNamespacesPagedResponse pagedListResponse = client.listNamespaces(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNamespacesList().get(0), resources.get(0)); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNamespacesRequest actualRequest = (ListNamespacesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listNamespacesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listNamespaces(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNamespaceTest() { + NamespaceName name2 = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + Namespace expectedResponse = Namespace.newBuilder().setName(name2.toString()).build(); + mockRegistrationService.addResponse(expectedResponse); + + NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + + Namespace actualResponse = client.getNamespace(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNamespaceRequest actualRequest = (GetNamespaceRequest) actualRequests.get(0); + + Assert.assertEquals(name, NamespaceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getNamespaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + + client.getNamespace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateNamespaceTest() { + NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + Namespace expectedResponse = Namespace.newBuilder().setName(name.toString()).build(); + mockRegistrationService.addResponse(expectedResponse); + + Namespace namespace = Namespace.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Namespace actualResponse = client.updateNamespace(namespace, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateNamespaceRequest actualRequest = (UpdateNamespaceRequest) actualRequests.get(0); + + Assert.assertEquals(namespace, actualRequest.getNamespace()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateNamespaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + Namespace namespace = Namespace.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateNamespace(namespace, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteNamespaceTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockRegistrationService.addResponse(expectedResponse); + + NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + + client.deleteNamespace(name); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNamespaceRequest actualRequest = (DeleteNamespaceRequest) actualRequests.get(0); + + Assert.assertEquals(name, NamespaceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteNamespaceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + + client.deleteNamespace(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createServiceTest() { + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + Service expectedResponse = Service.newBuilder().setName(name.toString()).build(); + mockRegistrationService.addResponse(expectedResponse); + + NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + Service service = Service.newBuilder().build(); + String serviceId = "serviceId-1724763419"; + + Service actualResponse = client.createService(parent, service, serviceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateServiceRequest actualRequest = (CreateServiceRequest) actualRequests.get(0); + + Assert.assertEquals(parent, NamespaceName.parse(actualRequest.getParent())); + Assert.assertEquals(service, actualRequest.getService()); + Assert.assertEquals(serviceId, actualRequest.getServiceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + Service service = Service.newBuilder().build(); + String serviceId = "serviceId-1724763419"; + + client.createService(parent, service, serviceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listServicesTest() { + String nextPageToken = ""; + Service servicesElement = Service.newBuilder().build(); + List services = Arrays.asList(servicesElement); + ListServicesResponse expectedResponse = + ListServicesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllServices(services) + .build(); + mockRegistrationService.addResponse(expectedResponse); + + NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + + ListServicesPagedResponse pagedListResponse = client.listServices(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getServicesList().get(0), resources.get(0)); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListServicesRequest actualRequest = (ListServicesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, NamespaceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listServicesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]"); + + client.listServices(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getServiceTest() { + ServiceName name2 = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + Service expectedResponse = Service.newBuilder().setName(name2.toString()).build(); + mockRegistrationService.addResponse(expectedResponse); + + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + + Service actualResponse = client.getService(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetServiceRequest actualRequest = (GetServiceRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + + client.getService(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateServiceTest() { + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + Service expectedResponse = Service.newBuilder().setName(name.toString()).build(); + mockRegistrationService.addResponse(expectedResponse); + + Service service = Service.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Service actualResponse = client.updateService(service, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateServiceRequest actualRequest = (UpdateServiceRequest) actualRequests.get(0); + + Assert.assertEquals(service, actualRequest.getService()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + Service service = Service.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateService(service, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteServiceTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockRegistrationService.addResponse(expectedResponse); + + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + + client.deleteService(name); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteServiceRequest actualRequest = (DeleteServiceRequest) actualRequests.get(0); + + Assert.assertEquals(name, ServiceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteServiceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + + client.deleteService(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createEndpointTest() { + EndpointName name = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + String address = "address-1147692044"; + int port = 3446913; + Endpoint expectedResponse = + Endpoint.newBuilder().setName(name.toString()).setAddress(address).setPort(port).build(); + mockRegistrationService.addResponse(expectedResponse); + + ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1135808507"; + + Endpoint actualResponse = client.createEndpoint(parent, endpoint, endpointId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEndpointRequest actualRequest = (CreateEndpointRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ServiceName.parse(actualRequest.getParent())); + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(endpointId, actualRequest.getEndpointId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + Endpoint endpoint = Endpoint.newBuilder().build(); + String endpointId = "endpointId-1135808507"; + + client.createEndpoint(parent, endpoint, endpointId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listEndpointsTest() { + String nextPageToken = ""; + Endpoint endpointsElement = Endpoint.newBuilder().build(); + List endpoints = Arrays.asList(endpointsElement); + ListEndpointsResponse expectedResponse = + ListEndpointsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllEndpoints(endpoints) + .build(); + mockRegistrationService.addResponse(expectedResponse); + + ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + + ListEndpointsPagedResponse pagedListResponse = client.listEndpoints(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEndpointsList().get(0), resources.get(0)); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEndpointsRequest actualRequest = (ListEndpointsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ServiceName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listEndpointsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]"); + + client.listEndpoints(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getEndpointTest() { + EndpointName name2 = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + String address = "address-1147692044"; + int port = 3446913; + Endpoint expectedResponse = + Endpoint.newBuilder().setName(name2.toString()).setAddress(address).setPort(port).build(); + mockRegistrationService.addResponse(expectedResponse); + + EndpointName name = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + + Endpoint actualResponse = client.getEndpoint(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEndpointRequest actualRequest = (GetEndpointRequest) actualRequests.get(0); + + Assert.assertEquals(name, EndpointName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + EndpointName name = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + + client.getEndpoint(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateEndpointTest() { + EndpointName name = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + String address = "address-1147692044"; + int port = 3446913; + Endpoint expectedResponse = + Endpoint.newBuilder().setName(name.toString()).setAddress(address).setPort(port).build(); + mockRegistrationService.addResponse(expectedResponse); + + Endpoint endpoint = Endpoint.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Endpoint actualResponse = client.updateEndpoint(endpoint, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateEndpointRequest actualRequest = (UpdateEndpointRequest) actualRequests.get(0); + + Assert.assertEquals(endpoint, actualRequest.getEndpoint()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + Endpoint endpoint = Endpoint.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateEndpoint(endpoint, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteEndpointTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockRegistrationService.addResponse(expectedResponse); + + EndpointName name = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + + client.deleteEndpoint(name); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEndpointRequest actualRequest = (DeleteEndpointRequest) actualRequests.get(0); + + Assert.assertEquals(name, EndpointName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteEndpointExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + EndpointName name = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + + client.deleteEndpoint(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockRegistrationService.addResponse(expectedResponse); + + ResourceName resource = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ResourceName resource = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build(); + + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockRegistrationService.addResponse(expectedResponse); + + ResourceName resource = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + Policy policy = Policy.newBuilder().build(); + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource.toString()).setPolicy(policy).build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ResourceName resource = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + Policy policy = Policy.newBuilder().build(); + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource.toString()) + .setPolicy(policy) + .build(); + + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockRegistrationService.addResponse(expectedResponse); + + ResourceName resource = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + List permissions = new ArrayList<>(); + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource.toString()) + .addAllPermissions(permissions) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegistrationService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRegistrationService.addException(exception); + + try { + ResourceName resource = + EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]"); + List permissions = new ArrayList<>(); + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource.toString()) + .addAllPermissions(permissions) + .build(); + + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/grpc-google-cloud-servicedirectory-v1beta1/pom.xml b/grpc-google-cloud-servicedirectory-v1beta1/pom.xml new file mode 100644 index 00000000..9751f570 --- /dev/null +++ b/grpc-google-cloud-servicedirectory-v1beta1/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-servicedirectory-v1beta1 + GRPC library for grpc-google-cloud-servicedirectory-v1beta1 + + com.google.cloud + google-cloud-servicedirectory-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-cloud-servicedirectory-v1beta1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceGrpc.java b/grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceGrpc.java new file mode 100644 index 00000000..076a5bd9 --- /dev/null +++ b/grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceGrpc.java @@ -0,0 +1,363 @@ +/* + * 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.servicedirectory.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service Directory API for looking up service data at runtime.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/servicedirectory/v1beta1/lookup_service.proto") +public final class LookupServiceGrpc { + + private LookupServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.servicedirectory.v1beta1.LookupService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse> + getResolveServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResolveService", + requestType = com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse> + getResolveServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse> + getResolveServiceMethod; + if ((getResolveServiceMethod = LookupServiceGrpc.getResolveServiceMethod) == null) { + synchronized (LookupServiceGrpc.class) { + if ((getResolveServiceMethod = LookupServiceGrpc.getResolveServiceMethod) == null) { + LookupServiceGrpc.getResolveServiceMethod = + getResolveServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResolveService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new LookupServiceMethodDescriptorSupplier("ResolveService")) + .build(); + } + } + } + return getResolveServiceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static LookupServiceStub newStub(io.grpc.Channel channel) { + return new LookupServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LookupServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new LookupServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LookupServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new LookupServiceFutureStub(channel); + } + + /** + * + * + *
+   * Service Directory API for looking up service data at runtime.
+   * 
+ */ + public abstract static class LookupServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public void resolveService( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getResolveServiceMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getResolveServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse>( + this, METHODID_RESOLVE_SERVICE))) + .build(); + } + } + + /** + * + * + *
+   * Service Directory API for looking up service data at runtime.
+   * 
+ */ + public static final class LookupServiceStub extends io.grpc.stub.AbstractStub { + private LookupServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private LookupServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LookupServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LookupServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public void resolveService( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getResolveServiceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service Directory API for looking up service data at runtime.
+   * 
+ */ + public static final class LookupServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private LookupServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private LookupServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LookupServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LookupServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse resolveService( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest request) { + return blockingUnaryCall(getChannel(), getResolveServiceMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service Directory API for looking up service data at runtime.
+   * 
+ */ + public static final class LookupServiceFutureStub + extends io.grpc.stub.AbstractStub { + private LookupServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private LookupServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LookupServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LookupServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse> + resolveService(com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getResolveServiceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_RESOLVE_SERVICE = 0; + + 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 LookupServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(LookupServiceImplBase 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_RESOLVE_SERVICE: + serviceImpl.resolveService( + (com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class LookupServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LookupServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("LookupService"); + } + } + + private static final class LookupServiceFileDescriptorSupplier + extends LookupServiceBaseDescriptorSupplier { + LookupServiceFileDescriptorSupplier() {} + } + + private static final class LookupServiceMethodDescriptorSupplier + extends LookupServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + LookupServiceMethodDescriptorSupplier(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 (LookupServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LookupServiceFileDescriptorSupplier()) + .addMethod(getResolveServiceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceGrpc.java b/grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceGrpc.java new file mode 100644 index 00000000..51fe7015 --- /dev/null +++ b/grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceGrpc.java @@ -0,0 +1,2397 @@ +/* + * 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.servicedirectory.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service Directory API for registering services. It defines the following
+ * resource model:
+ * - The API has a collection of
+ * [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]
+ * resources, named `projects/*/locations/*/namespaces/*`.
+ * - Each Namespace has a collection of
+ * [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named
+ * `projects/*/locations/*/namespaces/*/services/*`.
+ * - Each Service has a collection of
+ * [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]
+ * resources, named
+ * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/servicedirectory/v1beta1/registration_service.proto") +public final class RegistrationServiceGrpc { + + private RegistrationServiceGrpc() {} + + public static final String SERVICE_NAME = + "google.cloud.servicedirectory.v1beta1.RegistrationService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getCreateNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNamespace", + requestType = com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Namespace.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getCreateNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getCreateNamespaceMethod; + if ((getCreateNamespaceMethod = RegistrationServiceGrpc.getCreateNamespaceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getCreateNamespaceMethod = RegistrationServiceGrpc.getCreateNamespaceMethod) == null) { + RegistrationServiceGrpc.getCreateNamespaceMethod = + getCreateNamespaceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateNamespace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Namespace + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("CreateNamespace")) + .build(); + } + } + } + return getCreateNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse> + getListNamespacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNamespaces", + requestType = com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse> + getListNamespacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse> + getListNamespacesMethod; + if ((getListNamespacesMethod = RegistrationServiceGrpc.getListNamespacesMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getListNamespacesMethod = RegistrationServiceGrpc.getListNamespacesMethod) == null) { + RegistrationServiceGrpc.getListNamespacesMethod = + getListNamespacesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListNamespaces")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("ListNamespaces")) + .build(); + } + } + } + return getListNamespacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getGetNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNamespace", + requestType = com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Namespace.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getGetNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getGetNamespaceMethod; + if ((getGetNamespaceMethod = RegistrationServiceGrpc.getGetNamespaceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getGetNamespaceMethod = RegistrationServiceGrpc.getGetNamespaceMethod) == null) { + RegistrationServiceGrpc.getGetNamespaceMethod = + getGetNamespaceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNamespace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Namespace + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetNamespace")) + .build(); + } + } + } + return getGetNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getUpdateNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateNamespace", + requestType = com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Namespace.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getUpdateNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace> + getUpdateNamespaceMethod; + if ((getUpdateNamespaceMethod = RegistrationServiceGrpc.getUpdateNamespaceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getUpdateNamespaceMethod = RegistrationServiceGrpc.getUpdateNamespaceMethod) == null) { + RegistrationServiceGrpc.getUpdateNamespaceMethod = + getUpdateNamespaceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateNamespace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Namespace + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("UpdateNamespace")) + .build(); + } + } + } + return getUpdateNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest, + com.google.protobuf.Empty> + getDeleteNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNamespace", + requestType = com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest, + com.google.protobuf.Empty> + getDeleteNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest, + com.google.protobuf.Empty> + getDeleteNamespaceMethod; + if ((getDeleteNamespaceMethod = RegistrationServiceGrpc.getDeleteNamespaceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getDeleteNamespaceMethod = RegistrationServiceGrpc.getDeleteNamespaceMethod) == null) { + RegistrationServiceGrpc.getDeleteNamespaceMethod = + getDeleteNamespaceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteNamespace")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("DeleteNamespace")) + .build(); + } + } + } + return getDeleteNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getCreateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateService", + requestType = com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Service.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getCreateServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getCreateServiceMethod; + if ((getCreateServiceMethod = RegistrationServiceGrpc.getCreateServiceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getCreateServiceMethod = RegistrationServiceGrpc.getCreateServiceMethod) == null) { + RegistrationServiceGrpc.getCreateServiceMethod = + getCreateServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Service + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("CreateService")) + .build(); + } + } + } + return getCreateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest, + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse> + getListServicesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServices", + requestType = com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest, + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse> + getListServicesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest, + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse> + getListServicesMethod; + if ((getListServicesMethod = RegistrationServiceGrpc.getListServicesMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getListServicesMethod = RegistrationServiceGrpc.getListServicesMethod) == null) { + RegistrationServiceGrpc.getListServicesMethod = + getListServicesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListServices")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("ListServices")) + .build(); + } + } + } + return getListServicesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getGetServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetService", + requestType = com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Service.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getGetServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getGetServiceMethod; + if ((getGetServiceMethod = RegistrationServiceGrpc.getGetServiceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getGetServiceMethod = RegistrationServiceGrpc.getGetServiceMethod) == null) { + RegistrationServiceGrpc.getGetServiceMethod = + getGetServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Service + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetService")) + .build(); + } + } + } + return getGetServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getUpdateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateService", + requestType = com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Service.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getUpdateServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service> + getUpdateServiceMethod; + if ((getUpdateServiceMethod = RegistrationServiceGrpc.getUpdateServiceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getUpdateServiceMethod = RegistrationServiceGrpc.getUpdateServiceMethod) == null) { + RegistrationServiceGrpc.getUpdateServiceMethod = + getUpdateServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Service + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("UpdateService")) + .build(); + } + } + } + return getUpdateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteService", + requestType = com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest, + com.google.protobuf.Empty> + getDeleteServiceMethod; + if ((getDeleteServiceMethod = RegistrationServiceGrpc.getDeleteServiceMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getDeleteServiceMethod = RegistrationServiceGrpc.getDeleteServiceMethod) == null) { + RegistrationServiceGrpc.getDeleteServiceMethod = + getDeleteServiceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("DeleteService")) + .build(); + } + } + } + return getDeleteServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getCreateEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEndpoint", + requestType = com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getCreateEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getCreateEndpointMethod; + if ((getCreateEndpointMethod = RegistrationServiceGrpc.getCreateEndpointMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getCreateEndpointMethod = RegistrationServiceGrpc.getCreateEndpointMethod) == null) { + RegistrationServiceGrpc.getCreateEndpointMethod = + getCreateEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Endpoint + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("CreateEndpoint")) + .build(); + } + } + } + return getCreateEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse> + getListEndpointsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEndpoints", + requestType = com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse> + getListEndpointsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse> + getListEndpointsMethod; + if ((getListEndpointsMethod = RegistrationServiceGrpc.getListEndpointsMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getListEndpointsMethod = RegistrationServiceGrpc.getListEndpointsMethod) == null) { + RegistrationServiceGrpc.getListEndpointsMethod = + getListEndpointsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEndpoints")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("ListEndpoints")) + .build(); + } + } + } + return getListEndpointsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getGetEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEndpoint", + requestType = com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getGetEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getGetEndpointMethod; + if ((getGetEndpointMethod = RegistrationServiceGrpc.getGetEndpointMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getGetEndpointMethod = RegistrationServiceGrpc.getGetEndpointMethod) == null) { + RegistrationServiceGrpc.getGetEndpointMethod = + getGetEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Endpoint + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetEndpoint")) + .build(); + } + } + } + return getGetEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getUpdateEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateEndpoint", + requestType = com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.class, + responseType = com.google.cloud.servicedirectory.v1beta1.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getUpdateEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getUpdateEndpointMethod; + if ((getUpdateEndpointMethod = RegistrationServiceGrpc.getUpdateEndpointMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getUpdateEndpointMethod = RegistrationServiceGrpc.getUpdateEndpointMethod) == null) { + RegistrationServiceGrpc.getUpdateEndpointMethod = + getUpdateEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.Endpoint + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("UpdateEndpoint")) + .build(); + } + } + } + return getUpdateEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest, + com.google.protobuf.Empty> + getDeleteEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteEndpoint", + requestType = com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest, + com.google.protobuf.Empty> + getDeleteEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest, + com.google.protobuf.Empty> + getDeleteEndpointMethod; + if ((getDeleteEndpointMethod = RegistrationServiceGrpc.getDeleteEndpointMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getDeleteEndpointMethod = RegistrationServiceGrpc.getDeleteEndpointMethod) == null) { + RegistrationServiceGrpc.getDeleteEndpointMethod = + getDeleteEndpointMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteEndpoint")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("DeleteEndpoint")) + .build(); + } + } + } + return getDeleteEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = RegistrationServiceGrpc.getGetIamPolicyMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getGetIamPolicyMethod = RegistrationServiceGrpc.getGetIamPolicyMethod) == null) { + RegistrationServiceGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = RegistrationServiceGrpc.getSetIamPolicyMethod) == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getSetIamPolicyMethod = RegistrationServiceGrpc.getSetIamPolicyMethod) == null) { + RegistrationServiceGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = RegistrationServiceGrpc.getTestIamPermissionsMethod) + == null) { + synchronized (RegistrationServiceGrpc.class) { + if ((getTestIamPermissionsMethod = RegistrationServiceGrpc.getTestIamPermissionsMethod) + == null) { + RegistrationServiceGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RegistrationServiceStub newStub(io.grpc.Channel channel) { + return new RegistrationServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RegistrationServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new RegistrationServiceBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RegistrationServiceFutureStub newFutureStub(io.grpc.Channel channel) { + return new RegistrationServiceFutureStub(channel); + } + + /** + * + * + *
+   * Service Directory API for registering services. It defines the following
+   * resource model:
+   * - The API has a collection of
+   * [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public abstract static class RegistrationServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a namespace, and returns the new Namespace.
+     * 
+ */ + public void createNamespace( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateNamespaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public void listNamespaces( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListNamespacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public void getNamespace( + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetNamespaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public void updateNamespace( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateNamespaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a namespace. This also deletes all services and endpoints in
+     * the namespace.
+     * 
+ */ + public void deleteNamespace( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteNamespaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a service, and returns the new Service.
+     * 
+ */ + public void createService( + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateServiceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all services belonging to a namespace.
+     * 
+ */ + public void listServices( + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListServicesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public void getService( + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetServiceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public void updateService( + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateServiceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a service. This also deletes all endpoints associated with
+     * the service.
+     * 
+ */ + public void deleteService( + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteServiceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a endpoint, and returns the new Endpoint.
+     * 
+ */ + public void createEndpoint( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public void listEndpoints( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListEndpointsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public void getEndpoint( + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public void updateEndpoint( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public void deleteEndpoint( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Tests IAM permissions for a resource (namespace or service only).
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace>( + this, METHODID_CREATE_NAMESPACE))) + .addMethod( + getListNamespacesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse>( + this, METHODID_LIST_NAMESPACES))) + .addMethod( + getGetNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace>( + this, METHODID_GET_NAMESPACE))) + .addMethod( + getUpdateNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1beta1.Namespace>( + this, METHODID_UPDATE_NAMESPACE))) + .addMethod( + getDeleteNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_NAMESPACE))) + .addMethod( + getCreateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service>( + this, METHODID_CREATE_SERVICE))) + .addMethod( + getListServicesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest, + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse>( + this, METHODID_LIST_SERVICES))) + .addMethod( + getGetServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service>( + this, METHODID_GET_SERVICE))) + .addMethod( + getUpdateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1beta1.Service>( + this, METHODID_UPDATE_SERVICE))) + .addMethod( + getDeleteServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SERVICE))) + .addMethod( + getCreateEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint>( + this, METHODID_CREATE_ENDPOINT))) + .addMethod( + getListEndpointsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse>( + this, METHODID_LIST_ENDPOINTS))) + .addMethod( + getGetEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint>( + this, METHODID_GET_ENDPOINT))) + .addMethod( + getUpdateEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1beta1.Endpoint>( + this, METHODID_UPDATE_ENDPOINT))) + .addMethod( + getDeleteEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_ENDPOINT))) + .addMethod( + getGetIamPolicyMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getSetIamPolicyMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Service Directory API for registering services. It defines the following
+   * resource model:
+   * - The API has a collection of
+   * [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public static final class RegistrationServiceStub + extends io.grpc.stub.AbstractStub { + private RegistrationServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private RegistrationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RegistrationServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegistrationServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a namespace, and returns the new Namespace.
+     * 
+ */ + public void createNamespace( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateNamespaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public void listNamespaces( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListNamespacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public void getNamespace( + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetNamespaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public void updateNamespace( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateNamespaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a namespace. This also deletes all services and endpoints in
+     * the namespace.
+     * 
+ */ + public void deleteNamespace( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteNamespaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a service, and returns the new Service.
+     * 
+ */ + public void createService( + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateServiceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all services belonging to a namespace.
+     * 
+ */ + public void listServices( + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListServicesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public void getService( + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public void updateService( + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateServiceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a service. This also deletes all endpoints associated with
+     * the service.
+     * 
+ */ + public void deleteService( + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteServiceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a endpoint, and returns the new Endpoint.
+     * 
+ */ + public void createEndpoint( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public void listEndpoints( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListEndpointsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public void getEndpoint( + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public void updateEndpoint( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public void deleteEndpoint( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Tests IAM permissions for a resource (namespace or service only).
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service Directory API for registering services. It defines the following
+   * resource model:
+   * - The API has a collection of
+   * [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public static final class RegistrationServiceBlockingStub + extends io.grpc.stub.AbstractStub { + private RegistrationServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private RegistrationServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RegistrationServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegistrationServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a namespace, and returns the new Namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Namespace createNamespace( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getCreateNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse listNamespaces( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest request) { + return blockingUnaryCall(getChannel(), getListNamespacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace( + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getGetNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Namespace updateNamespace( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getUpdateNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a namespace. This also deletes all services and endpoints in
+     * the namespace.
+     * 
+ */ + public com.google.protobuf.Empty deleteNamespace( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getDeleteNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a service, and returns the new Service.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Service createService( + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest request) { + return blockingUnaryCall(getChannel(), getCreateServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all services belonging to a namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.ListServicesResponse listServices( + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest request) { + return blockingUnaryCall(getChannel(), getListServicesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Service getService( + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest request) { + return blockingUnaryCall(getChannel(), getGetServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Service updateService( + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest request) { + return blockingUnaryCall(getChannel(), getUpdateServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a service. This also deletes all endpoints associated with
+     * the service.
+     * 
+ */ + public com.google.protobuf.Empty deleteService( + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest request) { + return blockingUnaryCall(getChannel(), getDeleteServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a endpoint, and returns the new Endpoint.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint createEndpoint( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest request) { + return blockingUnaryCall(getChannel(), getCreateEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse listEndpoints( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest request) { + return blockingUnaryCall(getChannel(), getListEndpointsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint( + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest request) { + return blockingUnaryCall(getChannel(), getGetEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint updateEndpoint( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest request) { + return blockingUnaryCall(getChannel(), getUpdateEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public com.google.protobuf.Empty deleteEndpoint( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest request) { + return blockingUnaryCall(getChannel(), getDeleteEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return blockingUnaryCall(getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return blockingUnaryCall(getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Tests IAM permissions for a resource (namespace or service only).
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service Directory API for registering services. It defines the following
+   * resource model:
+   * - The API has a collection of
+   * [Namespace][google.cloud.servicedirectory.v1beta1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public static final class RegistrationServiceFutureStub + extends io.grpc.stub.AbstractStub { + private RegistrationServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private RegistrationServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RegistrationServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegistrationServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a namespace, and returns the new Namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Namespace> + createNamespace(com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateNamespaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse> + listNamespaces(com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListNamespacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Namespace> + getNamespace(com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetNamespaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Namespace> + updateNamespace(com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateNamespaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a namespace. This also deletes all services and endpoints in
+     * the namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteNamespace(com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteNamespaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a service, and returns the new Service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Service> + createService(com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateServiceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all services belonging to a namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse> + listServices(com.google.cloud.servicedirectory.v1beta1.ListServicesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListServicesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Service> + getService(com.google.cloud.servicedirectory.v1beta1.GetServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetServiceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Service> + updateService(com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateServiceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a service. This also deletes all endpoints associated with
+     * the service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteService(com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteServiceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a endpoint, and returns the new Endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Endpoint> + createEndpoint(com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse> + listEndpoints(com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListEndpointsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Endpoint> + getEndpoint(com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1beta1.Endpoint> + updateEndpoint(com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteEndpoint(com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the IAM Policy for a resource (namespace or service only).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Tests IAM permissions for a resource (namespace or service only).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_NAMESPACE = 0; + private static final int METHODID_LIST_NAMESPACES = 1; + private static final int METHODID_GET_NAMESPACE = 2; + private static final int METHODID_UPDATE_NAMESPACE = 3; + private static final int METHODID_DELETE_NAMESPACE = 4; + private static final int METHODID_CREATE_SERVICE = 5; + private static final int METHODID_LIST_SERVICES = 6; + private static final int METHODID_GET_SERVICE = 7; + private static final int METHODID_UPDATE_SERVICE = 8; + private static final int METHODID_DELETE_SERVICE = 9; + private static final int METHODID_CREATE_ENDPOINT = 10; + private static final int METHODID_LIST_ENDPOINTS = 11; + private static final int METHODID_GET_ENDPOINT = 12; + private static final int METHODID_UPDATE_ENDPOINT = 13; + private static final int METHODID_DELETE_ENDPOINT = 14; + private static final int METHODID_GET_IAM_POLICY = 15; + private static final int METHODID_SET_IAM_POLICY = 16; + private static final int METHODID_TEST_IAM_PERMISSIONS = 17; + + 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 RegistrationServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RegistrationServiceImplBase 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_NAMESPACE: + serviceImpl.createNamespace( + (com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_NAMESPACES: + serviceImpl.listNamespaces( + (com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse>) + responseObserver); + break; + case METHODID_GET_NAMESPACE: + serviceImpl.getNamespace( + (com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_NAMESPACE: + serviceImpl.updateNamespace( + (com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_NAMESPACE: + serviceImpl.deleteNamespace( + (com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SERVICE: + serviceImpl.createService( + (com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVICES: + serviceImpl.listServices( + (com.google.cloud.servicedirectory.v1beta1.ListServicesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse>) + responseObserver); + break; + case METHODID_GET_SERVICE: + serviceImpl.getService( + (com.google.cloud.servicedirectory.v1beta1.GetServiceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SERVICE: + serviceImpl.updateService( + (com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SERVICE: + serviceImpl.deleteService( + (com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_ENDPOINT: + serviceImpl.createEndpoint( + (com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ENDPOINTS: + serviceImpl.listEndpoints( + (com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse>) + responseObserver); + break; + case METHODID_GET_ENDPOINT: + serviceImpl.getEndpoint( + (com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ENDPOINT: + serviceImpl.updateEndpoint( + (com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_ENDPOINT: + serviceImpl.deleteEndpoint( + (com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class RegistrationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RegistrationServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RegistrationService"); + } + } + + private static final class RegistrationServiceFileDescriptorSupplier + extends RegistrationServiceBaseDescriptorSupplier { + RegistrationServiceFileDescriptorSupplier() {} + } + + private static final class RegistrationServiceMethodDescriptorSupplier + extends RegistrationServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RegistrationServiceMethodDescriptorSupplier(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 (RegistrationServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RegistrationServiceFileDescriptorSupplier()) + .addMethod(getCreateNamespaceMethod()) + .addMethod(getListNamespacesMethod()) + .addMethod(getGetNamespaceMethod()) + .addMethod(getUpdateNamespaceMethod()) + .addMethod(getDeleteNamespaceMethod()) + .addMethod(getCreateServiceMethod()) + .addMethod(getListServicesMethod()) + .addMethod(getGetServiceMethod()) + .addMethod(getUpdateServiceMethod()) + .addMethod(getDeleteServiceMethod()) + .addMethod(getCreateEndpointMethod()) + .addMethod(getListEndpointsMethod()) + .addMethod(getGetEndpointMethod()) + .addMethod(getUpdateEndpointMethod()) + .addMethod(getDeleteEndpointMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..252836cc --- /dev/null +++ b/pom.xml @@ -0,0 +1,262 @@ + + + 4.0.0 + com.google.cloud + google-cloud-servicedirectory-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Service Directory Parent + https://github.com/googleapis/java-servicedirectory + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.4.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-servicedirectory.git + scm:git:git@github.com:googleapis/java-servicedirectory.git + https://github.com/googleapis/java-servicedirectory + HEAD + + + https://github.com/googleapis/java-servicedirectory/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-servicedirectory-parent + 1.91.1 + 1.8.1 + 1.17.0 + 1.54.0 + 1.27.2 + 3.11.4 + 4.13 + 28.2-android + 1.4.1 + 1.3.2 + 1.18 + 0.13.0 + + + + + + com.google.api.grpc + proto-google-cloud-servicedirectory-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-servicedirectory + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-bom + ${grpc.version} + pom + import + + + com.google.api + gax-bom + ${gax.version} + pom + import + + + com.google.guava + guava-bom + ${guava.version} + pom + import + + + + com.google.protobuf + protobuf-java + ${protobuf.version} + + + com.google.api + api-common + ${google.api-common.version} + + + com.google.api.grpc + proto-google-common-protos + ${google.common-protos.version} + + + org.threeten + threetenbp + ${threeten.version} + + + javax.annotation + javax.annotation-api + ${javax.annotations.version} + + + org.codehaus.mojo + animal-sniffer-annotations + ${animal-sniffer.version} + + + com.google.api.grpc + proto-google-iam-v1 + ${google.proto-iam-v1.version} + + + + junit + junit + ${junit.version} + test + + + com.google.api + gax-grpc + ${gax.version} + testlib + test + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + proto-google-cloud-servicedirectory-v1beta1 + grpc-google-cloud-servicedirectory-v1beta1 + google-cloud-servicedirectory + google-cloud-servicedirectory-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-servicedirectory-v1beta1/pom.xml b/proto-google-cloud-servicedirectory-v1beta1/pom.xml new file mode 100644 index 00000000..5f7ca908 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-servicedirectory-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-servicedirectory-v1beta1 + PROTO library for proto-google-cloud-servicedirectory-v1beta1 + + com.google.cloud + google-cloud-servicedirectory-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.guava + guava + + + com.google.api + api-common + + + com.google.api.grpc + proto-google-iam-v1 + + + \ No newline at end of file diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequest.java new file mode 100644 index 00000000..fc53e218 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequest.java @@ -0,0 +1,1175 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.CreateEndpointRequest} + */ +public final class CreateEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) + CreateEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateEndpointRequest.newBuilder() to construct. + private CreateEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateEndpointRequest() { + parent_ = ""; + endpointId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateEndpointRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateEndpointRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + endpointId_ = s; + break; + } + case 26: + { + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder subBuilder = null; + if (endpoint_ != null) { + subBuilder = endpoint_.toBuilder(); + } + endpoint_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Endpoint.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpoint_); + endpoint_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the service that this endpoint provides.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the service that this endpoint provides.
+   * 
+ * + * + * 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 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 ENDPOINT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object endpointId_; + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The endpointId. + */ + public java.lang.String getEndpointId() { + java.lang.Object ref = endpointId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for endpointId. + */ + public com.google.protobuf.ByteString getEndpointIdBytes() { + java.lang.Object ref = endpointId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpointId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENDPOINT_FIELD_NUMBER = 3; + private com.google.cloud.servicedirectory.v1beta1.Endpoint endpoint_; + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + public boolean hasEndpoint() { + return endpoint_ != null; + } + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint() { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance() + : endpoint_; + } + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointOrBuilder() { + return getEndpoint(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getEndpointIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, endpointId_); + } + if (endpoint_ != null) { + output.writeMessage(3, getEndpoint()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getEndpointIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, endpointId_); + } + if (endpoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndpoint()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest other = + (com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getEndpointId().equals(other.getEndpointId())) return false; + if (hasEndpoint() != other.hasEndpoint()) return false; + if (hasEndpoint()) { + if (!getEndpoint().equals(other.getEndpoint())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + ENDPOINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getEndpointId().hashCode(); + if (hasEndpoint()) { + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest 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.servicedirectory.v1beta1.CreateEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest 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.servicedirectory.v1beta1.CreateEndpointRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest 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.servicedirectory.v1beta1.CreateEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest 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.servicedirectory.v1beta1.CreateEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest 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.servicedirectory.v1beta1.CreateEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.CreateEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + endpointId_ = ""; + + if (endpointBuilder_ == null) { + endpoint_ = null; + } else { + endpoint_ = null; + endpointBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest build() { + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest result = + new com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest(this); + result.parent_ = parent_; + result.endpointId_ = endpointId_; + if (endpointBuilder_ == null) { + result.endpoint_ = endpoint_; + } else { + result.endpoint_ = endpointBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getEndpointId().isEmpty()) { + endpointId_ = other.endpointId_; + onChanged(); + } + if (other.hasEndpoint()) { + mergeEndpoint(other.getEndpoint()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the service that this endpoint provides.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the service that this endpoint provides.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the service that this endpoint provides.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the service that this endpoint provides.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the service that this endpoint provides.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object endpointId_ = ""; + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The endpointId. + */ + public java.lang.String getEndpointId() { + java.lang.Object ref = endpointId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for endpointId. + */ + public com.google.protobuf.ByteString getEndpointIdBytes() { + java.lang.Object ref = endpointId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpointId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The endpointId to set. + * @return This builder for chaining. + */ + public Builder setEndpointId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endpointId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEndpointId() { + + endpointId_ = getDefaultInstance().getEndpointId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for endpointId to set. + * @return This builder for chaining. + */ + public Builder setEndpointIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + endpointId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Endpoint endpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + endpointBuilder_; + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + public boolean hasEndpoint() { + return endpointBuilder_ != null || endpoint_ != null; + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint() { + if (endpointBuilder_ == null) { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance() + : endpoint_; + } else { + return endpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + onChanged(); + } else { + endpointBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint( + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + endpoint_ = builderForValue.build(); + onChanged(); + } else { + endpointBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEndpoint(com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointBuilder_ == null) { + if (endpoint_ != null) { + endpoint_ = + com.google.cloud.servicedirectory.v1beta1.Endpoint.newBuilder(endpoint_) + .mergeFrom(value) + .buildPartial(); + } else { + endpoint_ = value; + } + onChanged(); + } else { + endpointBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEndpoint() { + if (endpointBuilder_ == null) { + endpoint_ = null; + onChanged(); + } else { + endpoint_ = null; + endpointBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder getEndpointBuilder() { + + onChanged(); + return getEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointOrBuilder() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilder(); + } else { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance() + : endpoint_; + } + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder>( + getEndpoint(), getParentForChildren(), isClean()); + endpoint_ = null; + } + return endpointBuilder_; + } + + @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.servicedirectory.v1beta1.CreateEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) + private static final com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateEndpointRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequestOrBuilder.java new file mode 100644 index 00000000..c2d41507 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface CreateEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.CreateEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the service that this endpoint provides.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the service that this endpoint provides.
+   * 
+ * + * + * 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 ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The endpointId. + */ + java.lang.String getEndpointId(); + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string endpoint_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for endpointId. + */ + com.google.protobuf.ByteString getEndpointIdBytes(); + + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + boolean hasEndpoint(); + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint(); + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequest.java new file mode 100644 index 00000000..67716683 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequest.java @@ -0,0 +1,1182 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest} + */ +public final class CreateNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) + CreateNamespaceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateNamespaceRequest.newBuilder() to construct. + private CreateNamespaceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateNamespaceRequest() { + parent_ = ""; + namespaceId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateNamespaceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateNamespaceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + namespaceId_ = s; + break; + } + case 26: + { + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder subBuilder = null; + if (namespace_ != null) { + subBuilder = namespace_.toBuilder(); + } + namespace_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Namespace.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(namespace_); + namespace_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the project and location the namespace
+   * will be created in.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the project and location the namespace
+   * will be created in.
+   * 
+ * + * + * 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 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 NAMESPACE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object namespaceId_; + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The namespaceId. + */ + public java.lang.String getNamespaceId() { + java.lang.Object ref = namespaceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespaceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for namespaceId. + */ + public com.google.protobuf.ByteString getNamespaceIdBytes() { + java.lang.Object ref = namespaceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespaceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAMESPACE_FIELD_NUMBER = 3; + private com.google.cloud.servicedirectory.v1beta1.Namespace namespace_; + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + public boolean hasNamespace() { + return namespace_ != null; + } + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace() { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance() + : namespace_; + } + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespaceOrBuilder() { + return getNamespace(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getNamespaceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, namespaceId_); + } + if (namespace_ != null) { + output.writeMessage(3, getNamespace()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getNamespaceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, namespaceId_); + } + if (namespace_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getNamespace()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest other = + (com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getNamespaceId().equals(other.getNamespaceId())) return false; + if (hasNamespace() != other.hasNamespace()) return false; + if (hasNamespace()) { + if (!getNamespace().equals(other.getNamespace())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + NAMESPACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceId().hashCode(); + if (hasNamespace()) { + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest 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.servicedirectory.v1beta1.CreateNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest 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.servicedirectory.v1beta1.CreateNamespaceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest 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.servicedirectory.v1beta1.CreateNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest 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.servicedirectory.v1beta1.CreateNamespaceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest 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.servicedirectory.v1beta1.CreateNamespaceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + namespaceId_ = ""; + + if (namespaceBuilder_ == null) { + namespace_ = null; + } else { + namespace_ = null; + namespaceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest build() { + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest result = + new com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest(this); + result.parent_ = parent_; + result.namespaceId_ = namespaceId_; + if (namespaceBuilder_ == null) { + result.namespace_ = namespace_; + } else { + result.namespace_ = namespaceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getNamespaceId().isEmpty()) { + namespaceId_ = other.namespaceId_; + onChanged(); + } + if (other.hasNamespace()) { + mergeNamespace(other.getNamespace()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the project and location the namespace
+     * will be created in.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the project and location the namespace
+     * will be created in.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the project and location the namespace
+     * will be created in.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the project and location the namespace
+     * will be created in.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the project and location the namespace
+     * will be created in.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object namespaceId_ = ""; + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The namespaceId. + */ + public java.lang.String getNamespaceId() { + java.lang.Object ref = namespaceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + namespaceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for namespaceId. + */ + public com.google.protobuf.ByteString getNamespaceIdBytes() { + java.lang.Object ref = namespaceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + namespaceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The namespaceId to set. + * @return This builder for chaining. + */ + public Builder setNamespaceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + namespaceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceId() { + + namespaceId_ = getDefaultInstance().getNamespaceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for namespaceId to set. + * @return This builder for chaining. + */ + public Builder setNamespaceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + namespaceId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Namespace namespace_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder> + namespaceBuilder_; + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + public boolean hasNamespace() { + return namespaceBuilder_ != null || namespace_ != null; + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace() { + if (namespaceBuilder_ == null) { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance() + : namespace_; + } else { + return namespaceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace(com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespaceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + namespace_ = value; + onChanged(); + } else { + namespaceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace( + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder builderForValue) { + if (namespaceBuilder_ == null) { + namespace_ = builderForValue.build(); + onChanged(); + } else { + namespaceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNamespace(com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespaceBuilder_ == null) { + if (namespace_ != null) { + namespace_ = + com.google.cloud.servicedirectory.v1beta1.Namespace.newBuilder(namespace_) + .mergeFrom(value) + .buildPartial(); + } else { + namespace_ = value; + } + onChanged(); + } else { + namespaceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNamespace() { + if (namespaceBuilder_ == null) { + namespace_ = null; + onChanged(); + } else { + namespace_ = null; + namespaceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace.Builder getNamespaceBuilder() { + + onChanged(); + return getNamespaceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespaceOrBuilder() { + if (namespaceBuilder_ != null) { + return namespaceBuilder_.getMessageOrBuilder(); + } else { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance() + : namespace_; + } + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder> + getNamespaceFieldBuilder() { + if (namespaceBuilder_ == null) { + namespaceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder>( + getNamespace(), getParentForChildren(), isClean()); + namespace_ = null; + } + return namespaceBuilder_; + } + + @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.servicedirectory.v1beta1.CreateNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNamespaceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateNamespaceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..d4a6257c --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface CreateNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the project and location the namespace
+   * will be created in.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the project and location the namespace
+   * will be created in.
+   * 
+ * + * + * 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 ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The namespaceId. + */ + java.lang.String getNamespaceId(); + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string namespace_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for namespaceId. + */ + com.google.protobuf.ByteString getNamespaceIdBytes(); + + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + boolean hasNamespace(); + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace(); + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespaceOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequest.java new file mode 100644 index 00000000..82f1b165 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequest.java @@ -0,0 +1,1174 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.CreateServiceRequest} + */ +public final class CreateServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.CreateServiceRequest) + CreateServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateServiceRequest.newBuilder() to construct. + private CreateServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateServiceRequest() { + parent_ = ""; + serviceId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateServiceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceId_ = s; + break; + } + case 26: + { + com.google.cloud.servicedirectory.v1beta1.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Service.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(service_); + service_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the namespace this service will belong to.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the namespace this service will belong to.
+   * 
+ * + * + * 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 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 SERVICE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object serviceId_; + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The serviceId. + */ + public java.lang.String getServiceId() { + java.lang.Object ref = serviceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for serviceId. + */ + public com.google.protobuf.ByteString getServiceIdBytes() { + java.lang.Object ref = serviceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_FIELD_NUMBER = 3; + private com.google.cloud.servicedirectory.v1beta1.Service service_; + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return service_ != null; + } + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1beta1.Service getService() { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder() { + return getService(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getServiceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, serviceId_); + } + if (service_ != null) { + output.writeMessage(3, getService()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getServiceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, serviceId_); + } + if (service_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getService()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest other = + (com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getServiceId().equals(other.getServiceId())) return false; + if (hasService() != other.hasService()) return false; + if (hasService()) { + if (!getService().equals(other.getService())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + SERVICE_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceId().hashCode(); + if (hasService()) { + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest 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.servicedirectory.v1beta1.CreateServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest 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.servicedirectory.v1beta1.CreateServiceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest 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.servicedirectory.v1beta1.CreateServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest 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.servicedirectory.v1beta1.CreateServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest 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.servicedirectory.v1beta1.CreateServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.CreateServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.CreateServiceRequest) + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + serviceId_ = ""; + + if (serviceBuilder_ == null) { + service_ = null; + } else { + service_ = null; + serviceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest build() { + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest result = + new com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest(this); + result.parent_ = parent_; + result.serviceId_ = serviceId_; + if (serviceBuilder_ == null) { + result.service_ = service_; + } else { + result.service_ = serviceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getServiceId().isEmpty()) { + serviceId_ = other.serviceId_; + onChanged(); + } + if (other.hasService()) { + mergeService(other.getService()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the namespace this service will belong to.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the namespace this service will belong to.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the namespace this service will belong to.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the namespace this service will belong to.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the namespace this service will belong to.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceId_ = ""; + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The serviceId. + */ + public java.lang.String getServiceId() { + java.lang.Object ref = serviceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for serviceId. + */ + public com.google.protobuf.ByteString getServiceIdBytes() { + java.lang.Object ref = serviceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The serviceId to set. + * @return This builder for chaining. + */ + public Builder setServiceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearServiceId() { + + serviceId_ = getDefaultInstance().getServiceId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Resource ID must be 1-63 characters long, and comply with
+     * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+     * Specifically, the name must be 1-63 characters long and match the regular
+     * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+     * character must be a lowercase letter, and all following characters must
+     * be a dash, lowercase letter, or digit, except the last character, which
+     * cannot be a dash.
+     * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for serviceId to set. + * @return This builder for chaining. + */ + public Builder setServiceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + serviceBuilder_; + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return serviceBuilder_ != null || service_ != null; + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1beta1.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService( + com.google.cloud.servicedirectory.v1beta1.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeService(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.cloud.servicedirectory.v1beta1.Service.newBuilder(service_) + .mergeFrom(value) + .buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + service_ = null; + serviceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder>( + getService(), getParentForChildren(), isClean()); + service_ = null; + } + return serviceBuilder_; + } + + @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.servicedirectory.v1beta1.CreateServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.CreateServiceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateServiceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequestOrBuilder.java new file mode 100644 index 00000000..4a7c9bb9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateServiceRequestOrBuilder.java @@ -0,0 +1,132 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface CreateServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.CreateServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the namespace this service will belong to.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the namespace this service will belong to.
+   * 
+ * + * + * 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 ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The serviceId. + */ + java.lang.String getServiceId(); + /** + * + * + *
+   * Required. The Resource ID must be 1-63 characters long, and comply with
+   * <a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
+   * Specifically, the name must be 1-63 characters long and match the regular
+   * expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
+   * character must be a lowercase letter, and all following characters must
+   * be a dash, lowercase letter, or digit, except the last character, which
+   * cannot be a dash.
+   * 
+ * + * string service_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for serviceId. + */ + com.google.protobuf.ByteString getServiceIdBytes(); + + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + boolean hasService(); + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + com.google.cloud.servicedirectory.v1beta1.Service getService(); + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequest.java new file mode 100644 index 00000000..8ffc70b8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequest.java @@ -0,0 +1,656 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest} + */ +public final class DeleteEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) + DeleteEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteEndpointRequest.newBuilder() to construct. + private DeleteEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteEndpointRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteEndpointRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteEndpointRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the endpoint to delete.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the endpoint to delete.
+   * 
+ * + * + * 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 java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest other = + (com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest 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.servicedirectory.v1beta1.DeleteEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest 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.servicedirectory.v1beta1.DeleteEndpointRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest 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.servicedirectory.v1beta1.DeleteEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest 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.servicedirectory.v1beta1.DeleteEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest 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.servicedirectory.v1beta1.DeleteEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest build() { + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest result = + new com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the endpoint to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the endpoint to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the endpoint to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the endpoint to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the endpoint to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) + private static final com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteEndpointRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequestOrBuilder.java new file mode 100644 index 00000000..cc78a129 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteEndpointRequestOrBuilder.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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface DeleteEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the endpoint to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the endpoint to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequest.java new file mode 100644 index 00000000..7e3b638b --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequest.java @@ -0,0 +1,656 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest} + */ +public final class DeleteNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) + DeleteNamespaceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteNamespaceRequest.newBuilder() to construct. + private DeleteNamespaceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteNamespaceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteNamespaceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteNamespaceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the namespace to delete.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the namespace to delete.
+   * 
+ * + * + * 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 java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest other = + (com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest 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.servicedirectory.v1beta1.DeleteNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest 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.servicedirectory.v1beta1.DeleteNamespaceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest 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.servicedirectory.v1beta1.DeleteNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest 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.servicedirectory.v1beta1.DeleteNamespaceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest 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.servicedirectory.v1beta1.DeleteNamespaceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest build() { + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest result = + new com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the namespace to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the namespace to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the namespace to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the namespace to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the namespace to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteNamespaceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteNamespaceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..6d063294 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteNamespaceRequestOrBuilder.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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface DeleteNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the namespace to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the namespace to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequest.java new file mode 100644 index 00000000..6d19f592 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequest.java @@ -0,0 +1,655 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.DeleteServiceRequest} + */ +public final class DeleteServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) + DeleteServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteServiceRequest.newBuilder() to construct. + private DeleteServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteServiceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteServiceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the service to delete.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to delete.
+   * 
+ * + * + * 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 java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest other = + (com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest 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.servicedirectory.v1beta1.DeleteServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest 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.servicedirectory.v1beta1.DeleteServiceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest 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.servicedirectory.v1beta1.DeleteServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest 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.servicedirectory.v1beta1.DeleteServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest 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.servicedirectory.v1beta1.DeleteServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.DeleteServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest build() { + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest result = + new com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the service to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to delete.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteServiceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequestOrBuilder.java new file mode 100644 index 00000000..60144770 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/DeleteServiceRequestOrBuilder.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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface DeleteServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.DeleteServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the service to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the service to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Endpoint.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Endpoint.java new file mode 100644 index 00000000..e251370d --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Endpoint.java @@ -0,0 +1,1317 @@ +/* + * 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/servicedirectory/v1beta1/endpoint.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * An individual endpoint that provides a
+ * [service][google.cloud.servicedirectory.v1beta1.Service]. The service must
+ * already exist to create an endpoint.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.Endpoint} + */ +public final class Endpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.Endpoint) + EndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use Endpoint.newBuilder() to construct. + private Endpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Endpoint() { + name_ = ""; + address_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Endpoint(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Endpoint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + address_ = s; + break; + } + case 24: + { + port_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.Endpoint.class, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The resource name for the endpoint in the format
+   * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + 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; + } + } + /** + * + * + *
+   * Immutable. The resource name for the endpoint in the format
+   * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + 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 ADDRESS_FIELD_NUMBER = 2; + private volatile java.lang.Object address_; + /** + * + * + *
+   * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+   * addresses like:
+   *   "8.8.8"
+   *   "8.8.8.8:53"
+   *   "test:bad:address"
+   *   "[::1]"
+   *   "[::1]:8080"
+   * Limited to 45 characters.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The address. + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+   * addresses like:
+   *   "8.8.8"
+   *   "8.8.8.8:53"
+   *   "test:bad:address"
+   *   "[::1]"
+   *   "[::1]:8080"
+   * Limited to 45 characters.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for address. + */ + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 3; + private int port_; + /** + * + * + *
+   * Optional. Service Directory will reject values outside of [0, 65535].
+   * 
+ * + * int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The port. + */ + public int getPort() { + return port_; + } + + public static final int METADATA_FIELD_NUMBER = 4; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.servicedirectory.v1beta1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, address_); + } + if (port_ != 0) { + output.writeInt32(3, port_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, address_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, port_); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.Endpoint)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.Endpoint other = + (com.google.cloud.servicedirectory.v1beta1.Endpoint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAddress().equals(other.getAddress())) return false; + if (getPort() != other.getPort()) return false; + if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint 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.servicedirectory.v1beta1.Endpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint 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.servicedirectory.v1beta1.Endpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint 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.servicedirectory.v1beta1.Endpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint 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.servicedirectory.v1beta1.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint 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.servicedirectory.v1beta1.Endpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An individual endpoint that provides a
+   * [service][google.cloud.servicedirectory.v1beta1.Service]. The service must
+   * already exist to create an endpoint.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.Endpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.Endpoint) + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.Endpoint.class, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.Endpoint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + address_ = ""; + + port_ = 0; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Endpoint getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Endpoint build() { + com.google.cloud.servicedirectory.v1beta1.Endpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Endpoint buildPartial() { + com.google.cloud.servicedirectory.v1beta1.Endpoint result = + new com.google.cloud.servicedirectory.v1beta1.Endpoint(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.address_ = address_; + result.port_ = port_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.Endpoint) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.Endpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.Endpoint other) { + if (other == com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.Endpoint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.Endpoint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The resource name for the endpoint in the format
+     * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name for the endpoint in the format
+     * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name for the endpoint in the format
+     * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name for the endpoint in the format
+     * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name for the endpoint in the format
+     * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object address_ = ""; + /** + * + * + *
+     * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+     * addresses like:
+     *   "8.8.8"
+     *   "8.8.8.8:53"
+     *   "test:bad:address"
+     *   "[::1]"
+     *   "[::1]:8080"
+     * Limited to 45 characters.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The address. + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+     * addresses like:
+     *   "8.8.8"
+     *   "8.8.8.8:53"
+     *   "test:bad:address"
+     *   "[::1]"
+     *   "[::1]:8080"
+     * Limited to 45 characters.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for address. + */ + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+     * addresses like:
+     *   "8.8.8"
+     *   "8.8.8.8:53"
+     *   "test:bad:address"
+     *   "[::1]"
+     *   "[::1]:8080"
+     * Limited to 45 characters.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + address_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+     * addresses like:
+     *   "8.8.8"
+     *   "8.8.8.8:53"
+     *   "test:bad:address"
+     *   "[::1]"
+     *   "[::1]:8080"
+     * Limited to 45 characters.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAddress() { + + address_ = getDefaultInstance().getAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+     * addresses like:
+     *   "8.8.8"
+     *   "8.8.8.8:53"
+     *   "test:bad:address"
+     *   "[::1]"
+     *   "[::1]:8080"
+     * Limited to 45 characters.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for address to set. + * @return This builder for chaining. + */ + public Builder setAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + address_ = value; + onChanged(); + return this; + } + + private int port_; + /** + * + * + *
+     * Optional. Service Directory will reject values outside of [0, 65535].
+     * 
+ * + * int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The port. + */ + public int getPort() { + return port_; + } + /** + * + * + *
+     * Optional. Service Directory will reject values outside of [0, 65535].
+     * 
+ * + * int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Service Directory will reject values outside of [0, 65535].
+     * 
+ * + * int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + + port_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putMetadata(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Metadata for the endpoint. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 512 characters,
+     * spread accoss all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllMetadata(java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + 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.servicedirectory.v1beta1.Endpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.Endpoint) + private static final com.google.cloud.servicedirectory.v1beta1.Endpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.Endpoint(); + } + + public static com.google.cloud.servicedirectory.v1beta1.Endpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Endpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Endpoint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Endpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointName.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointName.java new file mode 100644 index 00000000..9c1658de --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointName.java @@ -0,0 +1,277 @@ +/* + * 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.servicedirectory.v1beta1; + +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; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class EndpointName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String namespace; + private final String service; + private final String endpoint; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNamespace() { + return namespace; + } + + public String getService() { + return service; + } + + public String getEndpoint() { + return endpoint; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private EndpointName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + namespace = Preconditions.checkNotNull(builder.getNamespace()); + service = Preconditions.checkNotNull(builder.getService()); + endpoint = Preconditions.checkNotNull(builder.getEndpoint()); + } + + public static EndpointName of( + String project, String location, String namespace, String service, String endpoint) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setNamespace(namespace) + .setService(service) + .setEndpoint(endpoint) + .build(); + } + + public static String format( + String project, String location, String namespace, String service, String endpoint) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setNamespace(namespace) + .setService(service) + .setEndpoint(endpoint) + .build() + .toString(); + } + + public static EndpointName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "EndpointName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("namespace"), + matchMap.get("service"), + matchMap.get("endpoint")); + } + + 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 (EndpointName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("namespace", namespace); + fieldMapBuilder.put("service", service); + fieldMapBuilder.put("endpoint", endpoint); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", + project, + "location", + location, + "namespace", + namespace, + "service", + service, + "endpoint", + endpoint); + } + + /** Builder for EndpointName. */ + public static class Builder { + + private String project; + private String location; + private String namespace; + private String service; + private String endpoint; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNamespace() { + return namespace; + } + + public String getService() { + return service; + } + + public String getEndpoint() { + return endpoint; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + public Builder setEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + private Builder() {} + + private Builder(EndpointName endpointName) { + project = endpointName.project; + location = endpointName.location; + namespace = endpointName.namespace; + service = endpointName.service; + endpoint = endpointName.endpoint; + } + + public EndpointName build() { + return new EndpointName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof EndpointName) { + EndpointName that = (EndpointName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.namespace.equals(that.namespace)) + && (this.service.equals(that.service)) + && (this.endpoint.equals(that.endpoint)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= namespace.hashCode(); + h *= 1000003; + h ^= service.hashCode(); + h *= 1000003; + h ^= endpoint.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointOrBuilder.java new file mode 100644 index 00000000..e8c114f1 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointOrBuilder.java @@ -0,0 +1,173 @@ +/* + * 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/servicedirectory/v1beta1/endpoint.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface EndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.Endpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The resource name for the endpoint in the format
+   * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The resource name for the endpoint in the format
+   * 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+   * addresses like:
+   *   "8.8.8"
+   *   "8.8.8.8:53"
+   *   "test:bad:address"
+   *   "[::1]"
+   *   "[::1]:8080"
+   * Limited to 45 characters.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Optional. An IPv4 or IPv6 address. Service Directory will reject bad
+   * addresses like:
+   *   "8.8.8"
+   *   "8.8.8.8:53"
+   *   "test:bad:address"
+   *   "[::1]"
+   *   "[::1]:8080"
+   * Limited to 45 characters.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for address. + */ + com.google.protobuf.ByteString getAddressBytes(); + + /** + * + * + *
+   * Optional. Service Directory will reject values outside of [0, 65535].
+   * 
+ * + * int32 port = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getMetadataCount(); + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Metadata for the endpoint. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 512 characters,
+   * spread accoss all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getMetadataOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointProto.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointProto.java new file mode 100644 index 00000000..fb3e52e3 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/EndpointProto.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/endpoint.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public final class EndpointProto { + private EndpointProto() {} + + 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_servicedirectory_v1beta1_Endpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_MetadataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/servicedirectory/v1beta1/" + + "endpoint.proto\022%google.cloud.servicedire" + + "ctory.v1beta1\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032\034googl" + + "e/api/annotations.proto\"\346\002\n\010Endpoint\022\021\n\004" + + "name\030\001 \001(\tB\003\340A\005\022\024\n\007address\030\002 \001(\tB\003\340A\001\022\021\n" + + "\004port\030\003 \001(\005B\003\340A\001\022T\n\010metadata\030\004 \003(\0132=.goo" + + "gle.cloud.servicedirectory.v1beta1.Endpo" + + "int.MetadataEntryB\003\340A\001\032/\n\rMetadataEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\226\001\352A\222\001\n(" + + "servicedirectory.googleapis.com/Endpoint" + + "\022fprojects/{project}/locations/{location" + + "}/namespaces/{namespace}/services/{servi" + + "ce}/endpoints/{endpoint}B\226\001\n)com.google." + + "cloud.servicedirectory.v1beta1B\rEndpoint" + + "ProtoP\001ZUgoogle.golang.org/genproto/goog" + + "leapis/cloud/servicedirectory/v1beta1;se" + + "rvicedirectory\370\001\001b\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.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_descriptor, + new java.lang.String[] { + "Name", "Address", "Port", "Metadata", + }); + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_MetadataEntry_descriptor = + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_Endpoint_MetadataEntry_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.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequest.java new file mode 100644 index 00000000..268cf0f6 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequest.java @@ -0,0 +1,656 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint].
+ * This should not be used to lookup endpoints at runtime. Instead, use
+ * the `resolve` method.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.GetEndpointRequest} + */ +public final class GetEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.GetEndpointRequest) + GetEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEndpointRequest.newBuilder() to construct. + private GetEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEndpointRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEndpointRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetEndpointRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the endpoint to get.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the endpoint to get.
+   * 
+ * + * + * 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 java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest other = + (com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest 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.servicedirectory.v1beta1.GetEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest 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.servicedirectory.v1beta1.GetEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest 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.servicedirectory.v1beta1.GetEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest 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.servicedirectory.v1beta1.GetEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest 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.servicedirectory.v1beta1.GetEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint].
+   * This should not be used to lookup endpoints at runtime. Instead, use
+   * the `resolve` method.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.GetEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.GetEndpointRequest) + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest build() { + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest result = + new com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the endpoint to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the endpoint to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the endpoint to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the endpoint to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the endpoint to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.GetEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.GetEndpointRequest) + private static final com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetEndpointRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequestOrBuilder.java new file mode 100644 index 00000000..e2047ea8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetEndpointRequestOrBuilder.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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface GetEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.GetEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the endpoint to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the endpoint to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequest.java new file mode 100644 index 00000000..8cfbe83b --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.GetNamespaceRequest} + */ +public final class GetNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) + GetNamespaceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetNamespaceRequest.newBuilder() to construct. + private GetNamespaceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetNamespaceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetNamespaceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetNamespaceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the namespace to retrieve.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the namespace to retrieve.
+   * 
+ * + * + * 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 java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest other = + (com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest 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.servicedirectory.v1beta1.GetNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest 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.servicedirectory.v1beta1.GetNamespaceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest 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.servicedirectory.v1beta1.GetNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest 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.servicedirectory.v1beta1.GetNamespaceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest 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.servicedirectory.v1beta1.GetNamespaceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.GetNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest build() { + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest result = + new com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the namespace to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the namespace to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the namespace to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the namespace to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the namespace to retrieve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNamespaceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNamespaceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..af0d5cba --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetNamespaceRequestOrBuilder.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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface GetNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.GetNamespaceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the namespace to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the namespace to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequest.java new file mode 100644 index 00000000..edc17fec --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService].
+ * This should not be used for looking up a service. Insead, use the `resolve`
+ * method as it will contain all endpoints and associated metadata.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.GetServiceRequest} + */ +public final class GetServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.GetServiceRequest) + GetServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetServiceRequest.newBuilder() to construct. + private GetServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetServiceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetServiceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the service to get.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to get.
+   * 
+ * + * + * 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 java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.GetServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest other = + (com.google.cloud.servicedirectory.v1beta1.GetServiceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest 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.servicedirectory.v1beta1.GetServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest 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.servicedirectory.v1beta1.GetServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest 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.servicedirectory.v1beta1.GetServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest 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.servicedirectory.v1beta1.GetServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest 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.servicedirectory.v1beta1.GetServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService].
+   * This should not be used for looking up a service. Insead, use the `resolve`
+   * method as it will contain all endpoints and associated metadata.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.GetServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.GetServiceRequest) + com.google.cloud.servicedirectory.v1beta1.GetServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetServiceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetServiceRequest build() { + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest result = + new com.google.cloud.servicedirectory.v1beta1.GetServiceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.GetServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.GetServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.GetServiceRequest other) { + if (other == com.google.cloud.servicedirectory.v1beta1.GetServiceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.GetServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.GetServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the service to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.GetServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.GetServiceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.GetServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.GetServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.GetServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetServiceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.GetServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequestOrBuilder.java new file mode 100644 index 00000000..e95b3874 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/GetServiceRequestOrBuilder.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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface GetServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.GetServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the service to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the service to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequest.java new file mode 100644 index 00000000..24ee7ba7 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequest.java @@ -0,0 +1,1442 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListEndpointsRequest} + */ +public final class ListEndpointsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) + ListEndpointsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEndpointsRequest.newBuilder() to construct. + private ListEndpointsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEndpointsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEndpointsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListEndpointsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.class, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the service whose endpoints we'd like to
+   * list.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the service whose endpoints we'd like to
+   * list.
+   * 
+ * + * + * 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 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_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + 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; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC".
+   * * "address=192.108.1.105" returns Endpoints that have this address.
+   * * "port>8080" returns Endpoints that have port number larger than 8080.
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+   *   returns Endpoints that have name that is alphabetically later than the
+   *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Endpoints, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC".
+   * * "address=192.108.1.105" returns Endpoints that have this address.
+   * * "port>8080" returns Endpoints that have port number larger than 8080.
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+   *   returns Endpoints that have name that is alphabetically later than the
+   *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Endpoints, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + 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; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest other = + (com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest 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.servicedirectory.v1beta1.ListEndpointsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest 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.servicedirectory.v1beta1.ListEndpointsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest 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.servicedirectory.v1beta1.ListEndpointsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest 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.servicedirectory.v1beta1.ListEndpointsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest 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.servicedirectory.v1beta1.ListEndpointsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListEndpointsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.class, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest build() { + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest result = + new com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the service whose endpoints we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the service whose endpoints we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the service whose endpoints we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the service whose endpoints we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the service whose endpoints we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC".
+     * * "address=192.108.1.105" returns Endpoints that have this address.
+     * * "port>8080" returns Endpoints that have port number larger than 8080.
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+     *   returns Endpoints that have name that is alphabetically later than the
+     *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Endpoints, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC".
+     * * "address=192.108.1.105" returns Endpoints that have this address.
+     * * "port>8080" returns Endpoints that have port number larger than 8080.
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+     *   returns Endpoints that have name that is alphabetically later than the
+     *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Endpoints, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC".
+     * * "address=192.108.1.105" returns Endpoints that have this address.
+     * * "port>8080" returns Endpoints that have port number larger than 8080.
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+     *   returns Endpoints that have name that is alphabetically later than the
+     *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Endpoints, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC".
+     * * "address=192.108.1.105" returns Endpoints that have this address.
+     * * "port>8080" returns Endpoints that have port number larger than 8080.
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+     *   returns Endpoints that have name that is alphabetically later than the
+     *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Endpoints, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC".
+     * * "address=192.108.1.105" returns Endpoints that have this address.
+     * * "port>8080" returns Endpoints that have port number larger than 8080.
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+     *   returns Endpoints that have name that is alphabetically later than the
+     *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Endpoints, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) + private static final com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEndpointsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListEndpointsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequestOrBuilder.java new file mode 100644 index 00000000..4a3c9963 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ListEndpointsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ListEndpointsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the service whose endpoints we'd like to
+   * list.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the service whose endpoints we'd like to
+   * list.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC".
+   * * "address=192.108.1.105" returns Endpoints that have this address.
+   * * "port>8080" returns Endpoints that have port number larger than 8080.
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+   *   returns Endpoints that have name that is alphabetically later than the
+   *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Endpoints, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", "address", "port" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC".
+   * * "address=192.108.1.105" returns Endpoints that have this address.
+   * * "port>8080" returns Endpoints that have port number larger than 8080.
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c"
+   *   returns Endpoints that have name that is alphabetically later than the
+   *   string, so "endpoint-e" will be returned but "endpoint-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Endpoints, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponse.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponse.java new file mode 100644 index 00000000..3de05a85 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponse.java @@ -0,0 +1,1147 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListEndpointsResponse} + */ +public final class ListEndpointsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) + ListEndpointsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListEndpointsResponse.newBuilder() to construct. + private ListEndpointsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListEndpointsResponse() { + endpoints_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListEndpointsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListEndpointsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + endpoints_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + endpoints_.add( + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Endpoint.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.class, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.Builder.class); + } + + public static final int ENDPOINTS_FIELD_NUMBER = 1; + private java.util.List endpoints_; + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List + getEndpointsOrBuilderList() { + return endpoints_; + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointsOrBuilder( + int index) { + return endpoints_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + 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; + } + } + + 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 < endpoints_.size(); i++) { + output.writeMessage(1, endpoints_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < endpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, endpoints_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse other = + (com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) obj; + + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse 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.servicedirectory.v1beta1.ListEndpointsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse 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.servicedirectory.v1beta1.ListEndpointsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse 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.servicedirectory.v1beta1.ListEndpointsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse 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.servicedirectory.v1beta1.ListEndpointsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse 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.servicedirectory.v1beta1.ListEndpointsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListEndpointsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.class, + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEndpointsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + endpointsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse build() { + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse result = + new com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse(this); + int from_bitField0_ = bitField0_; + if (endpointsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.endpoints_ = endpoints_; + } else { + result.endpoints_ = endpointsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse.getDefaultInstance()) + return this; + if (endpointsBuilder_ == null) { + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + } else { + if (!other.endpoints_.isEmpty()) { + if (endpointsBuilder_.isEmpty()) { + endpointsBuilder_.dispose(); + endpointsBuilder_ = null; + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000001); + endpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndpointsFieldBuilder() + : null; + } else { + endpointsBuilder_.addAllMessages(other.endpoints_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List endpoints_ = + java.util.Collections.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + endpoints_ = + new java.util.ArrayList(endpoints_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List getEndpointsList() { + if (endpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endpoints_); + } else { + return endpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public int getEndpointsCount() { + if (endpointsBuilder_ == null) { + return endpoints_.size(); + } else { + return endpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoints(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder setEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder setEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints(com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + } else { + endpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(index, value); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints( + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder addEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder addAllEndpoints( + java.lang.Iterable values) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + onChanged(); + } else { + endpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder clearEndpoints() { + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + endpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public Builder removeEndpoints(int index) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.remove(index); + onChanged(); + } else { + endpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder getEndpointsBuilder( + int index) { + return getEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointsOrBuilder( + int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List + getEndpointsOrBuilderList() { + if (endpointsBuilder_ != null) { + return endpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endpoints_); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder addEndpointsBuilder( + int index) { + return getEndpointsFieldBuilder() + .addBuilder( + index, com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + public java.util.List + getEndpointsBuilderList() { + return getEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder>( + endpoints_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + endpoints_ = null; + } + return endpointsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @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.servicedirectory.v1beta1.ListEndpointsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) + private static final com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEndpointsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListEndpointsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponseOrBuilder.java new file mode 100644 index 00000000..1dc632c9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListEndpointsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ListEndpointsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ListEndpointsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoints(int index); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + int getEndpointsCount(); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + java.util.List + getEndpointsOrBuilderList(); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 1; + */ + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequest.java new file mode 100644 index 00000000..c1703fae --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequest.java @@ -0,0 +1,1471 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListNamespacesRequest} + */ +public final class ListNamespacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) + ListNamespacesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNamespacesRequest.newBuilder() to construct. + private ListNamespacesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNamespacesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNamespacesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListNamespacesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.class, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the project and location whose namespaces we'd like to
+   * list.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the project and location whose namespaces we'd like to
+   * list.
+   * 
+ * + * + * 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 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_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + 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; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "labels.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "labels.owner" returns Namespaces that have a label with the key "owner"
+   *   this is the same as "labels:owner".
+   * * "labels.protocol=gRPC" returns Namespaces that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+   *   returns Namespaces that have name that is alphabetically later than the
+   *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+   * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Namespaces, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "labels.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "labels.owner" returns Namespaces that have a label with the key "owner"
+   *   this is the same as "labels:owner".
+   * * "labels.protocol=gRPC" returns Namespaces that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+   *   returns Namespaces that have name that is alphabetically later than the
+   *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+   * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Namespaces, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + 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; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. The order to list result by.
+   * General order by string syntax:
+   * <field> (<asc|desc>) (,)
+   * <field> allows values {"name"}
+   * <asc/desc> ascending or descending order by <field>. If this is left
+   * blank, "asc" is used.
+   * Note that an empty order_by string result in default order, which is order
+   * by name in ascending order.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The order to list result by.
+   * General order by string syntax:
+   * <field> (<asc|desc>) (,)
+   * <field> allows values {"name"}
+   * <asc/desc> ascending or descending order by <field>. If this is left
+   * blank, "asc" is used.
+   * Note that an empty order_by string result in default order, which is order
+   * by name in ascending order.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest other = + (com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest 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.servicedirectory.v1beta1.ListNamespacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest 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.servicedirectory.v1beta1.ListNamespacesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest 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.servicedirectory.v1beta1.ListNamespacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest 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.servicedirectory.v1beta1.ListNamespacesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest 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.servicedirectory.v1beta1.ListNamespacesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListNamespacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.class, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest build() { + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest result = + new com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the project and location whose namespaces we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the project and location whose namespaces we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the project and location whose namespaces we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the project and location whose namespaces we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the project and location whose namespaces we'd like to
+     * list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "labels.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "labels.owner" returns Namespaces that have a label with the key "owner"
+     *   this is the same as "labels:owner".
+     * * "labels.protocol=gRPC" returns Namespaces that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+     *   returns Namespaces that have name that is alphabetically later than the
+     *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+     * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Namespaces, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "labels.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "labels.owner" returns Namespaces that have a label with the key "owner"
+     *   this is the same as "labels:owner".
+     * * "labels.protocol=gRPC" returns Namespaces that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+     *   returns Namespaces that have name that is alphabetically later than the
+     *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+     * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Namespaces, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "labels.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "labels.owner" returns Namespaces that have a label with the key "owner"
+     *   this is the same as "labels:owner".
+     * * "labels.protocol=gRPC" returns Namespaces that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+     *   returns Namespaces that have name that is alphabetically later than the
+     *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+     * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Namespaces, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "labels.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "labels.owner" returns Namespaces that have a label with the key "owner"
+     *   this is the same as "labels:owner".
+     * * "labels.protocol=gRPC" returns Namespaces that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+     *   returns Namespaces that have name that is alphabetically later than the
+     *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+     * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Namespaces, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "labels.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "labels.owner" returns Namespaces that have a label with the key "owner"
+     *   this is the same as "labels:owner".
+     * * "labels.protocol=gRPC" returns Namespaces that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+     *   returns Namespaces that have name that is alphabetically later than the
+     *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+     * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Namespaces, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. The order to list result by.
+     * General order by string syntax:
+     * <field> (<asc|desc>) (,)
+     * <field> allows values {"name"}
+     * <asc/desc> ascending or descending order by <field>. If this is left
+     * blank, "asc" is used.
+     * Note that an empty order_by string result in default order, which is order
+     * by name in ascending order.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * General order by string syntax:
+     * <field> (<asc|desc>) (,)
+     * <field> allows values {"name"}
+     * <asc/desc> ascending or descending order by <field>. If this is left
+     * blank, "asc" is used.
+     * Note that an empty order_by string result in default order, which is order
+     * by name in ascending order.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * General order by string syntax:
+     * <field> (<asc|desc>) (,)
+     * <field> allows values {"name"}
+     * <asc/desc> ascending or descending order by <field>. If this is left
+     * blank, "asc" is used.
+     * Note that an empty order_by string result in default order, which is order
+     * by name in ascending order.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * General order by string syntax:
+     * <field> (<asc|desc>) (,)
+     * <field> allows values {"name"}
+     * <asc/desc> ascending or descending order by <field>. If this is left
+     * blank, "asc" is used.
+     * Note that an empty order_by string result in default order, which is order
+     * by name in ascending order.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * General order by string syntax:
+     * <field> (<asc|desc>) (,)
+     * <field> allows values {"name"}
+     * <asc/desc> ascending or descending order by <field>. If this is left
+     * blank, "asc" is used.
+     * Note that an empty order_by string result in default order, which is order
+     * by name in ascending order.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) + private static final com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNamespacesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNamespacesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequestOrBuilder.java new file mode 100644 index 00000000..6d098303 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesRequestOrBuilder.java @@ -0,0 +1,198 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ListNamespacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ListNamespacesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the project and location whose namespaces we'd like to
+   * list.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the project and location whose namespaces we'd like to
+   * list.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "labels.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "labels.owner" returns Namespaces that have a label with the key "owner"
+   *   this is the same as "labels:owner".
+   * * "labels.protocol=gRPC" returns Namespaces that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+   *   returns Namespaces that have name that is alphabetically later than the
+   *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+   * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Namespaces, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "labels.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "labels.owner" returns Namespaces that have a label with the key "owner"
+   *   this is the same as "labels:owner".
+   * * "labels.protocol=gRPC" returns Namespaces that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/namespace-c"
+   *   returns Namespaces that have name that is alphabetically later than the
+   *   string, so "namespace-e" will be returned but "namespace-a" will not be.
+   * * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Namespaces, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The order to list result by.
+   * General order by string syntax:
+   * <field> (<asc|desc>) (,)
+   * <field> allows values {"name"}
+   * <asc/desc> ascending or descending order by <field>. If this is left
+   * blank, "asc" is used.
+   * Note that an empty order_by string result in default order, which is order
+   * by name in ascending order.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. The order to list result by.
+   * General order by string syntax:
+   * <field> (<asc|desc>) (,)
+   * <field> allows values {"name"}
+   * <asc/desc> ascending or descending order by <field>. If this is left
+   * blank, "asc" is used.
+   * Note that an empty order_by string result in default order, which is order
+   * by name in ascending order.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponse.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponse.java new file mode 100644 index 00000000..9eef0e45 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponse.java @@ -0,0 +1,1148 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListNamespacesResponse} + */ +public final class ListNamespacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) + ListNamespacesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListNamespacesResponse.newBuilder() to construct. + private ListNamespacesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListNamespacesResponse() { + namespaces_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNamespacesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListNamespacesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + namespaces_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + namespaces_.add( + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Namespace.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + namespaces_ = java.util.Collections.unmodifiableList(namespaces_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.class, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.Builder.class); + } + + public static final int NAMESPACES_FIELD_NUMBER = 1; + private java.util.List namespaces_; + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public java.util.List getNamespacesList() { + return namespaces_; + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public java.util.List + getNamespacesOrBuilderList() { + return namespaces_; + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public int getNamespacesCount() { + return namespaces_.size(); + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespaces(int index) { + return namespaces_.get(index); + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespacesOrBuilder( + int index) { + return namespaces_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + 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; + } + } + + 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 < namespaces_.size(); i++) { + output.writeMessage(1, namespaces_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < namespaces_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, namespaces_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse other = + (com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) obj; + + if (!getNamespacesList().equals(other.getNamespacesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNamespacesCount() > 0) { + hash = (37 * hash) + NAMESPACES_FIELD_NUMBER; + hash = (53 * hash) + getNamespacesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse 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.servicedirectory.v1beta1.ListNamespacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse 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.servicedirectory.v1beta1.ListNamespacesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse 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.servicedirectory.v1beta1.ListNamespacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse 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.servicedirectory.v1beta1.ListNamespacesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse 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.servicedirectory.v1beta1.ListNamespacesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListNamespacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.class, + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getNamespacesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (namespacesBuilder_ == null) { + namespaces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + namespacesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse build() { + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse result = + new com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse(this); + int from_bitField0_ = bitField0_; + if (namespacesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + namespaces_ = java.util.Collections.unmodifiableList(namespaces_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.namespaces_ = namespaces_; + } else { + result.namespaces_ = namespacesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse.getDefaultInstance()) + return this; + if (namespacesBuilder_ == null) { + if (!other.namespaces_.isEmpty()) { + if (namespaces_.isEmpty()) { + namespaces_ = other.namespaces_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNamespacesIsMutable(); + namespaces_.addAll(other.namespaces_); + } + onChanged(); + } + } else { + if (!other.namespaces_.isEmpty()) { + if (namespacesBuilder_.isEmpty()) { + namespacesBuilder_.dispose(); + namespacesBuilder_ = null; + namespaces_ = other.namespaces_; + bitField0_ = (bitField0_ & ~0x00000001); + namespacesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNamespacesFieldBuilder() + : null; + } else { + namespacesBuilder_.addAllMessages(other.namespaces_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List namespaces_ = + java.util.Collections.emptyList(); + + private void ensureNamespacesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + namespaces_ = + new java.util.ArrayList( + namespaces_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder> + namespacesBuilder_; + + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public java.util.List getNamespacesList() { + if (namespacesBuilder_ == null) { + return java.util.Collections.unmodifiableList(namespaces_); + } else { + return namespacesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public int getNamespacesCount() { + if (namespacesBuilder_ == null) { + return namespaces_.size(); + } else { + return namespacesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespaces(int index) { + if (namespacesBuilder_ == null) { + return namespaces_.get(index); + } else { + return namespacesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder setNamespaces( + int index, com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespacesIsMutable(); + namespaces_.set(index, value); + onChanged(); + } else { + namespacesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder setNamespaces( + int index, com.google.cloud.servicedirectory.v1beta1.Namespace.Builder builderForValue) { + if (namespacesBuilder_ == null) { + ensureNamespacesIsMutable(); + namespaces_.set(index, builderForValue.build()); + onChanged(); + } else { + namespacesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder addNamespaces(com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespacesIsMutable(); + namespaces_.add(value); + onChanged(); + } else { + namespacesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder addNamespaces( + int index, com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespacesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespacesIsMutable(); + namespaces_.add(index, value); + onChanged(); + } else { + namespacesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder addNamespaces( + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder builderForValue) { + if (namespacesBuilder_ == null) { + ensureNamespacesIsMutable(); + namespaces_.add(builderForValue.build()); + onChanged(); + } else { + namespacesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder addNamespaces( + int index, com.google.cloud.servicedirectory.v1beta1.Namespace.Builder builderForValue) { + if (namespacesBuilder_ == null) { + ensureNamespacesIsMutable(); + namespaces_.add(index, builderForValue.build()); + onChanged(); + } else { + namespacesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder addAllNamespaces( + java.lang.Iterable values) { + if (namespacesBuilder_ == null) { + ensureNamespacesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaces_); + onChanged(); + } else { + namespacesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder clearNamespaces() { + if (namespacesBuilder_ == null) { + namespaces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + namespacesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public Builder removeNamespaces(int index) { + if (namespacesBuilder_ == null) { + ensureNamespacesIsMutable(); + namespaces_.remove(index); + onChanged(); + } else { + namespacesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace.Builder getNamespacesBuilder( + int index) { + return getNamespacesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespacesOrBuilder( + int index) { + if (namespacesBuilder_ == null) { + return namespaces_.get(index); + } else { + return namespacesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public java.util.List + getNamespacesOrBuilderList() { + if (namespacesBuilder_ != null) { + return namespacesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(namespaces_); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace.Builder addNamespacesBuilder() { + return getNamespacesFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance()); + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace.Builder addNamespacesBuilder( + int index) { + return getNamespacesFieldBuilder() + .addBuilder( + index, com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance()); + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + public java.util.List + getNamespacesBuilderList() { + return getNamespacesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder> + getNamespacesFieldBuilder() { + if (namespacesBuilder_ == null) { + namespacesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder>( + namespaces_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + namespaces_ = null; + } + return namespacesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @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.servicedirectory.v1beta1.ListNamespacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) + private static final com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNamespacesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNamespacesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponseOrBuilder.java new file mode 100644 index 00000000..afd7c931 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListNamespacesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ListNamespacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ListNamespacesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + java.util.List getNamespacesList(); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + com.google.cloud.servicedirectory.v1beta1.Namespace getNamespaces(int index); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + int getNamespacesCount(); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + java.util.List + getNamespacesOrBuilderList(); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Namespace namespaces = 1; + */ + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespacesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequest.java new file mode 100644 index 00000000..0e438c96 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequest.java @@ -0,0 +1,1426 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListServicesRequest} + */ +public final class ListServicesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ListServicesRequest) + ListServicesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServicesRequest.newBuilder() to construct. + private ListServicesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServicesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServicesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServicesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.class, + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The resource name of the namespace whose services we'd
+   * like to list.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the namespace whose services we'd
+   * like to list.
+   * 
+ * + * + * 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 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_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + 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; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Services that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Services that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+   *   returns Services that have name that is alphabetically later than the
+   *   string, so "service-e" will be returned but "service-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Services, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Services that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Services that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+   *   returns Services that have name that is alphabetically later than the
+   *   string, so "service-e" will be returned but "service-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Services, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + 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; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + 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; + } + } + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ListServicesRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest other = + (com.google.cloud.servicedirectory.v1beta1.ListServicesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest 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.servicedirectory.v1beta1.ListServicesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest 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.servicedirectory.v1beta1.ListServicesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest 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.servicedirectory.v1beta1.ListServicesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest 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.servicedirectory.v1beta1.ListServicesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest 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.servicedirectory.v1beta1.ListServicesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListServicesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ListServicesRequest) + com.google.cloud.servicedirectory.v1beta1.ListServicesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.class, + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesRequest build() { + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest result = + new com.google.cloud.servicedirectory.v1beta1.ListServicesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ListServicesRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ListServicesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.ListServicesRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ListServicesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ListServicesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ListServicesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The resource name of the namespace whose services we'd
+     * like to list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the namespace whose services we'd
+     * like to list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the namespace whose services we'd
+     * like to list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the namespace whose services we'd
+     * like to list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the namespace whose services we'd
+     * like to list.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of items to return.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Services that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Services that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+     *   returns Services that have name that is alphabetically later than the
+     *   string, so "service-e" will be returned but "service-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Services, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Services that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Services that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+     *   returns Services that have name that is alphabetically later than the
+     *   string, so "service-e" will be returned but "service-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Services, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Services that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Services that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+     *   returns Services that have name that is alphabetically later than the
+     *   string, so "service-e" will be returned but "service-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Services, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Services that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Services that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+     *   returns Services that have name that is alphabetically later than the
+     *   string, so "service-e" will be returned but "service-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Services, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter to list result by.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name", or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+     * is roughly the same as "=".
+     * <value> must be the same data type as field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Services that have a label with the key "owner"
+     *   this is the same as "metadata:owner".
+     * * "metadata.protocol=gRPC" returns Services that have key/value
+     *   "protocol=gRPC".
+     * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+     *   returns Services that have name that is alphabetically later than the
+     *   string, so "service-e" will be returned but "service-a" will not be.
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+     *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+     * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+     *   have a field called "doesnotexist". Since the filter does not match any
+     *   Services, it returns no results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The order to list result by.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.ListServicesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ListServicesRequest) + private static final com.google.cloud.servicedirectory.v1beta1.ListServicesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ListServicesRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServicesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServicesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequestOrBuilder.java new file mode 100644 index 00000000..3f794a15 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesRequestOrBuilder.java @@ -0,0 +1,186 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ListServicesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ListServicesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the namespace whose services we'd
+   * like to list.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the namespace whose services we'd
+   * like to list.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Services that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Services that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+   *   returns Services that have name that is alphabetically later than the
+   *   string, so "service-e" will be returned but "service-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Services, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. The filter to list result by.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name", or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and
+   * is roughly the same as "=".
+   * <value> must be the same data type as field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Services that have a label with the key "owner"
+   *   this is the same as "metadata:owner".
+   * * "metadata.protocol=gRPC" returns Services that have key/value
+   *   "protocol=gRPC".
+   * * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c"
+   *   returns Services that have name that is alphabetically later than the
+   *   string, so "service-e" will be returned but "service-a" will not be.
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have
+   *   "owner" in label key but value is not "sd" AND have key/value foo=bar.
+   * * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't
+   *   have a field called "doesnotexist". Since the filter does not match any
+   *   Services, it returns no results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponse.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponse.java new file mode 100644 index 00000000..9e29bda8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponse.java @@ -0,0 +1,1142 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListServicesResponse} + */ +public final class ListServicesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ListServicesResponse) + ListServicesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListServicesResponse.newBuilder() to construct. + private ListServicesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListServicesResponse() { + services_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListServicesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListServicesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + services_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + services_.add( + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Service.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + services_ = java.util.Collections.unmodifiableList(services_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.class, + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.Builder.class); + } + + public static final int SERVICES_FIELD_NUMBER = 1; + private java.util.List services_; + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public java.util.List getServicesList() { + return services_; + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public java.util.List + getServicesOrBuilderList() { + return services_; + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public int getServicesCount() { + return services_.size(); + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Service getServices(int index) { + return services_.get(index); + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServicesOrBuilder( + int index) { + return services_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + 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; + } + } + + 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 < services_.size(); i++) { + output.writeMessage(1, services_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < services_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, services_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ListServicesResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse other = + (com.google.cloud.servicedirectory.v1beta1.ListServicesResponse) obj; + + if (!getServicesList().equals(other.getServicesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getServicesCount() > 0) { + hash = (37 * hash) + SERVICES_FIELD_NUMBER; + hash = (53 * hash) + getServicesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse 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.servicedirectory.v1beta1.ListServicesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse 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.servicedirectory.v1beta1.ListServicesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse 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.servicedirectory.v1beta1.ListServicesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse 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.servicedirectory.v1beta1.ListServicesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse 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.servicedirectory.v1beta1.ListServicesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ListServicesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ListServicesResponse) + com.google.cloud.servicedirectory.v1beta1.ListServicesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.class, + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServicesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servicesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesResponse + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesResponse build() { + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesResponse buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse result = + new com.google.cloud.servicedirectory.v1beta1.ListServicesResponse(this); + int from_bitField0_ = bitField0_; + if (servicesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + services_ = java.util.Collections.unmodifiableList(services_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.services_ = services_; + } else { + result.services_ = servicesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ListServicesResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ListServicesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.ListServicesResponse other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ListServicesResponse.getDefaultInstance()) + return this; + if (servicesBuilder_ == null) { + if (!other.services_.isEmpty()) { + if (services_.isEmpty()) { + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServicesIsMutable(); + services_.addAll(other.services_); + } + onChanged(); + } + } else { + if (!other.services_.isEmpty()) { + if (servicesBuilder_.isEmpty()) { + servicesBuilder_.dispose(); + servicesBuilder_ = null; + services_ = other.services_; + bitField0_ = (bitField0_ & ~0x00000001); + servicesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServicesFieldBuilder() + : null; + } else { + servicesBuilder_.addAllMessages(other.services_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ListServicesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ListServicesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List services_ = + java.util.Collections.emptyList(); + + private void ensureServicesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + services_ = + new java.util.ArrayList(services_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + servicesBuilder_; + + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public java.util.List getServicesList() { + if (servicesBuilder_ == null) { + return java.util.Collections.unmodifiableList(services_); + } else { + return servicesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public int getServicesCount() { + if (servicesBuilder_ == null) { + return services_.size(); + } else { + return servicesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Service getServices(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); + } else { + return servicesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder setServices(int index, com.google.cloud.servicedirectory.v1beta1.Service value) { + if (servicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServicesIsMutable(); + services_.set(index, value); + onChanged(); + } else { + servicesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder setServices( + int index, com.google.cloud.servicedirectory.v1beta1.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.set(index, builderForValue.build()); + onChanged(); + } else { + servicesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder addServices(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (servicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServicesIsMutable(); + services_.add(value); + onChanged(); + } else { + servicesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder addServices(int index, com.google.cloud.servicedirectory.v1beta1.Service value) { + if (servicesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServicesIsMutable(); + services_.add(index, value); + onChanged(); + } else { + servicesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder addServices( + com.google.cloud.servicedirectory.v1beta1.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(builderForValue.build()); + onChanged(); + } else { + servicesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder addServices( + int index, com.google.cloud.servicedirectory.v1beta1.Service.Builder builderForValue) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.add(index, builderForValue.build()); + onChanged(); + } else { + servicesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder addAllServices( + java.lang.Iterable values) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, services_); + onChanged(); + } else { + servicesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder clearServices() { + if (servicesBuilder_ == null) { + services_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + servicesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public Builder removeServices(int index) { + if (servicesBuilder_ == null) { + ensureServicesIsMutable(); + services_.remove(index); + onChanged(); + } else { + servicesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Service.Builder getServicesBuilder(int index) { + return getServicesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServicesOrBuilder( + int index) { + if (servicesBuilder_ == null) { + return services_.get(index); + } else { + return servicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public java.util.List + getServicesOrBuilderList() { + if (servicesBuilder_ != null) { + return servicesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(services_); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Service.Builder addServicesBuilder() { + return getServicesFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance()); + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1beta1.Service.Builder addServicesBuilder(int index) { + return getServicesFieldBuilder() + .addBuilder( + index, com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance()); + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + public java.util.List + getServicesBuilderList() { + return getServicesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + getServicesFieldBuilder() { + if (servicesBuilder_ == null) { + servicesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder>( + services_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + services_ = null; + } + return servicesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @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.servicedirectory.v1beta1.ListServicesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ListServicesResponse) + private static final com.google.cloud.servicedirectory.v1beta1.ListServicesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ListServicesResponse(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ListServicesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListServicesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListServicesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ListServicesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponseOrBuilder.java new file mode 100644 index 00000000..6ad8bfc8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ListServicesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ListServicesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ListServicesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + java.util.List getServicesList(); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + com.google.cloud.servicedirectory.v1beta1.Service getServices(int index); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + int getServicesCount(); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + java.util.List + getServicesOrBuilderList(); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1beta1.Service services = 1; + */ + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServicesOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LocationName.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LocationName.java new file mode 100644 index 00000000..2ac633d3 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LocationName.java @@ -0,0 +1,182 @@ +/* + * 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.servicedirectory.v1beta1; + +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; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + 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 = + PATH_TEMPLATE.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 PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + 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() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceProto.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceProto.java new file mode 100644 index 00000000..30c7b62e --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceProto.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public final class LookupServiceProto { + private LookupServiceProto() {} + + 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_servicedirectory_v1beta1_ResolveServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_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/servicedirectory/v1beta1/" + + "lookup_service.proto\022%google.cloud.servi" + + "cedirectory.v1beta1\032\034google/api/annotati" + + "ons.proto\032\037google/api/field_behavior.pro" + + "to\032\031google/api/resource.proto\0323google/cl" + + "oud/servicedirectory/v1beta1/service.pro" + + "to\032\027google/api/client.proto\"\220\001\n\025ResolveS" + + "erviceRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'ser" + + "vicedirectory.googleapis.com/Service\022\032\n\r" + + "max_endpoints\030\002 \001(\005B\003\340A\001\022\034\n\017endpoint_fil" + + "ter\030\003 \001(\tB\003\340A\001\"Y\n\026ResolveServiceResponse" + + "\022?\n\007service\030\001 \001(\0132..google.cloud.service" + + "directory.v1beta1.Service2\307\002\n\rLookupServ" + + "ice\022\340\001\n\016ResolveService\022<.google.cloud.se" + + "rvicedirectory.v1beta1.ResolveServiceReq" + + "uest\032=.google.cloud.servicedirectory.v1b" + + "eta1.ResolveServiceResponse\"Q\202\323\344\223\002K\"F/v1" + + "beta1/{name=projects/*/locations/*/names" + + "paces/*/services/*}:resolve:\001*\032S\312A\037servi" + + "cedirectory.googleapis.com\322A.https://www" + + ".googleapis.com/auth/cloud-platformB\233\001\n)" + + "com.google.cloud.servicedirectory.v1beta" + + "1B\022LookupServiceProtoP\001ZUgoogle.golang.o" + + "rg/genproto/googleapis/cloud/servicedire" + + "ctory/v1beta1;servicedirectory\370\001\001b\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.servicedirectory.v1beta1.ServiceProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_descriptor, + new java.lang.String[] { + "Name", "MaxEndpoints", "EndpointFilter", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_descriptor, + new java.lang.String[] { + "Service", + }); + 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.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.servicedirectory.v1beta1.ServiceProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Namespace.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Namespace.java new file mode 100644 index 00000000..78b3f984 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Namespace.java @@ -0,0 +1,981 @@ +/* + * 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/servicedirectory/v1beta1/namespace.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * A container for [services][google.cloud.servicedirectory.v1beta1.Service].
+ * Namespaces allow administrators to group services together and define
+ * permissions for a collection of services.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.Namespace} + */ +public final class Namespace extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.Namespace) + NamespaceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Namespace.newBuilder() to construct. + private Namespace(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Namespace() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Namespace(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Namespace( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Namespace_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + 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.servicedirectory.v1beta1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Namespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.Namespace.class, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The resource name for the namespace in the format
+   * 'projects/*/locations/*/namespaces/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + 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; + } + } + /** + * + * + *
+   * Immutable. The resource name for the namespace in the format
+   * 'projects/*/locations/*/namespaces/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + 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 LABELS_FIELD_NUMBER = 2; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.servicedirectory.v1beta1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Namespace_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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(2, labels__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.Namespace)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.Namespace other = + (com.google.cloud.servicedirectory.v1beta1.Namespace) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace 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.servicedirectory.v1beta1.Namespace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace 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.servicedirectory.v1beta1.Namespace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace 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.servicedirectory.v1beta1.Namespace parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace 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.servicedirectory.v1beta1.Namespace parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace 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.servicedirectory.v1beta1.Namespace prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A container for [services][google.cloud.servicedirectory.v1beta1.Service].
+   * Namespaces allow administrators to group services together and define
+   * permissions for a collection of services.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.Namespace} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.Namespace) + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Namespace_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + 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.servicedirectory.v1beta1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Namespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.Namespace.class, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.Namespace.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + internalGetMutableLabels().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Namespace_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Namespace getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Namespace build() { + com.google.cloud.servicedirectory.v1beta1.Namespace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Namespace buildPartial() { + com.google.cloud.servicedirectory.v1beta1.Namespace result = + new com.google.cloud.servicedirectory.v1beta1.Namespace(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.Namespace) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.Namespace) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.Namespace other) { + if (other == com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.Namespace parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.Namespace) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The resource name for the namespace in the format
+     * 'projects/*/locations/*/namespaces/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name for the namespace in the format
+     * 'projects/*/locations/*/namespaces/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name for the namespace in the format
+     * 'projects/*/locations/*/namespaces/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name for the namespace in the format
+     * 'projects/*/locations/*/namespaces/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name for the namespace in the format
+     * 'projects/*/locations/*/namespaces/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Resource labels associated with this Namespace.
+     * No more than 64 user labels can be associated with a given resource.  Label
+     * keys and values can be no longer than 63 characters.
+     * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + 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.servicedirectory.v1beta1.Namespace) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.Namespace) + private static final com.google.cloud.servicedirectory.v1beta1.Namespace DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.Namespace(); + } + + public static com.google.cloud.servicedirectory.v1beta1.Namespace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Namespace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Namespace(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Namespace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceName.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceName.java new file mode 100644 index 00000000..25dfcbff --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceName.java @@ -0,0 +1,211 @@ +/* + * 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.servicedirectory.v1beta1; + +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; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NamespaceName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/namespaces/{namespace}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String namespace; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNamespace() { + return namespace; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private NamespaceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + namespace = Preconditions.checkNotNull(builder.getNamespace()); + } + + public static NamespaceName of(String project, String location, String namespace) { + return newBuilder().setProject(project).setLocation(location).setNamespace(namespace).build(); + } + + public static String format(String project, String location, String namespace) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setNamespace(namespace) + .build() + .toString(); + } + + public static NamespaceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "NamespaceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("namespace")); + } + + 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 (NamespaceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("namespace", namespace); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "namespace", namespace); + } + + /** Builder for NamespaceName. */ + public static class Builder { + + private String project; + private String location; + private String namespace; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNamespace() { + return namespace; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + private Builder() {} + + private Builder(NamespaceName namespaceName) { + project = namespaceName.project; + location = namespaceName.location; + namespace = namespaceName.namespace; + } + + public NamespaceName build() { + return new NamespaceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NamespaceName) { + NamespaceName that = (NamespaceName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.namespace.equals(that.namespace)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= namespace.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceOrBuilder.java new file mode 100644 index 00000000..7dd4d978 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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/servicedirectory/v1beta1/namespace.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface NamespaceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.Namespace) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The resource name for the namespace in the format
+   * 'projects/*/locations/*/namespaces/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The resource name for the namespace in the format
+   * 'projects/*/locations/*/namespaces/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Resource labels associated with this Namespace.
+   * No more than 64 user labels can be associated with a given resource.  Label
+   * keys and values can be no longer than 63 characters.
+   * 
+ * + * map<string, string> labels = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceProto.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceProto.java new file mode 100644 index 00000000..5084023f --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/NamespaceProto.java @@ -0,0 +1,102 @@ +/* + * 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/servicedirectory/v1beta1/namespace.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public final class NamespaceProto { + private NamespaceProto() {} + + 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_servicedirectory_v1beta1_Namespace_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_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 = { + "\n5google/cloud/servicedirectory/v1beta1/" + + "namespace.proto\022%google.cloud.servicedir" + + "ectory.v1beta1\032\037google/api/field_behavio" + + "r.proto\032\031google/api/resource.proto\032\034goog" + + "le/api/annotations.proto\"\220\002\n\tNamespace\022\021" + + "\n\004name\030\001 \001(\tB\003\340A\005\022Q\n\006labels\030\002 \003(\0132<.goog" + + "le.cloud.servicedirectory.v1beta1.Namesp" + + "ace.LabelsEntryB\003\340A\001\032-\n\013LabelsEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:n\352Ak\n)servic" + + "edirectory.googleapis.com/Namespace\022>pro" + + "jects/{project}/locations/{location}/nam" + + "espaces/{namespace}B\227\001\n)com.google.cloud" + + ".servicedirectory.v1beta1B\016NamespaceProt" + + "oP\001ZUgoogle.golang.org/genproto/googleap" + + "is/cloud/servicedirectory/v1beta1;servic" + + "edirectory\370\001\001b\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.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_descriptor, + new java.lang.String[] { + "Name", "Labels", + }); + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_LabelsEntry_descriptor = + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_Namespace_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.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceProto.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceProto.java new file mode 100644 index 00000000..29ce9f0a --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceProto.java @@ -0,0 +1,479 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public final class RegistrationServiceProto { + private RegistrationServiceProto() {} + + 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_servicedirectory_v1beta1_CreateNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_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/servicedirectory/v1beta1/" + + "registration_service.proto\022%google.cloud" + + ".servicedirectory.v1beta1\032\034google/api/an" + + "notations.proto\032\027google/api/client.proto" + + "\032\037google/api/field_behavior.proto\032\031googl" + + "e/api/resource.proto\0324google/cloud/servi" + + "cedirectory/v1beta1/endpoint.proto\0325goog" + + "le/cloud/servicedirectory/v1beta1/namesp" + + "ace.proto\0323google/cloud/servicedirectory" + + "/v1beta1/service.proto\032\036google/iam/v1/ia" + + "m_policy.proto\032\032google/iam/v1/policy.pro" + + "to\032\033google/protobuf/empty.proto\032 google/" + + "protobuf/field_mask.proto\"\270\001\n\026CreateName" + + "spaceRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!lo" + + "cations.googleapis.com/Location\022\031\n\014names" + + "pace_id\030\002 \001(\tB\003\340A\002\022H\n\tnamespace\030\003 \001(\01320." + + "google.cloud.servicedirectory.v1beta1.Na" + + "mespaceB\003\340A\002\"\257\001\n\025ListNamespacesRequest\0229" + + "\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.google" + + "apis.com/Location\022\026\n\tpage_size\030\002 \001(\005B\003\340A" + + "\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001" + + "(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"w\n\026ListNa" + + "mespacesResponse\022D\n\nnamespaces\030\001 \003(\01320.g" + + "oogle.cloud.servicedirectory.v1beta1.Nam" + + "espace\022\027\n\017next_page_token\030\002 \001(\t\"V\n\023GetNa" + + "mespaceRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)se" + + "rvicedirectory.googleapis.com/Namespace\"" + + "\230\001\n\026UpdateNamespaceRequest\022H\n\tnamespace\030" + + "\001 \001(\01320.google.cloud.servicedirectory.v1" + + "beta1.NamespaceB\003\340A\002\0224\n\013update_mask\030\002 \001(" + + "\0132\032.google.protobuf.FieldMaskB\003\340A\002\"Y\n\026De" + + "leteNamespaceRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372" + + "A+\n)servicedirectory.googleapis.com/Name" + + "space\"\270\001\n\024CreateServiceRequest\022A\n\006parent" + + "\030\001 \001(\tB1\340A\002\372A+\n)servicedirectory.googlea" + + "pis.com/Namespace\022\027\n\nservice_id\030\002 \001(\tB\003\340" + + "A\002\022D\n\007service\030\003 \001(\0132..google.cloud.servi" + + "cedirectory.v1beta1.ServiceB\003\340A\002\"\265\001\n\023Lis" + + "tServicesRequest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+" + + "\n)servicedirectory.googleapis.com/Namesp" + + "ace\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_toke" + + "n\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010ord" + + "er_by\030\005 \001(\tB\003\340A\001\"q\n\024ListServicesResponse" + + "\022@\n\010services\030\001 \003(\0132..google.cloud.servic" + + "edirectory.v1beta1.Service\022\027\n\017next_page_" + + "token\030\002 \001(\t\"R\n\021GetServiceRequest\022=\n\004name" + + "\030\001 \001(\tB/\340A\002\372A)\n\'servicedirectory.googlea" + + "pis.com/Service\"\222\001\n\024UpdateServiceRequest" + + "\022D\n\007service\030\001 \001(\0132..google.cloud.service" + + "directory.v1beta1.ServiceB\003\340A\002\0224\n\013update" + + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB" + + "\003\340A\002\"U\n\024DeleteServiceRequest\022=\n\004name\030\001 \001" + + "(\tB/\340A\002\372A)\n\'servicedirectory.googleapis." + + "com/Service\"\272\001\n\025CreateEndpointRequest\022?\n" + + "\006parent\030\001 \001(\tB/\340A\002\372A)\n\'servicedirectory." + + "googleapis.com/Service\022\030\n\013endpoint_id\030\002 " + + "\001(\tB\003\340A\002\022F\n\010endpoint\030\003 \001(\0132/.google.clou" + + "d.servicedirectory.v1beta1.EndpointB\003\340A\002" + + "\"\264\001\n\024ListEndpointsRequest\022?\n\006parent\030\001 \001(" + + "\tB/\340A\002\372A)\n\'servicedirectory.googleapis.c" + + "om/Service\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npa" + + "ge_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001" + + "\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"t\n\025ListEndpoints" + + "Response\022B\n\tendpoints\030\001 \003(\0132/.google.clo" + + "ud.servicedirectory.v1beta1.Endpoint\022\027\n\017" + + "next_page_token\030\002 \001(\t\"T\n\022GetEndpointRequ" + + "est\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(servicedirect" + + "ory.googleapis.com/Endpoint\"\225\001\n\025UpdateEn" + + "dpointRequest\022F\n\010endpoint\030\001 \001(\0132/.google" + + ".cloud.servicedirectory.v1beta1.Endpoint" + + "B\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMaskB\003\340A\002\"W\n\025DeleteEndpointReq" + + "uest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(servicedirec" + + "tory.googleapis.com/Endpoint2\317 \n\023Registr" + + "ationService\022\352\001\n\017CreateNamespace\022=.googl" + + "e.cloud.servicedirectory.v1beta1.CreateN" + + "amespaceRequest\0320.google.cloud.servicedi" + + "rectory.v1beta1.Namespace\"f\202\323\344\223\002@\"3/v1be" + + "ta1/{parent=projects/*/locations/*}/name" + + "spaces:\tnamespace\332A\035parent,namespace,nam" + + "espace_id\022\323\001\n\016ListNamespaces\022<.google.cl" + + "oud.servicedirectory.v1beta1.ListNamespa" + + "cesRequest\032=.google.cloud.servicedirecto" + + "ry.v1beta1.ListNamespacesResponse\"D\202\323\344\223\002" + + "5\0223/v1beta1/{parent=projects/*/locations" + + "/*}/namespaces\332A\006parent\022\300\001\n\014GetNamespace" + + "\022:.google.cloud.servicedirectory.v1beta1" + + ".GetNamespaceRequest\0320.google.cloud.serv" + + "icedirectory.v1beta1.Namespace\"B\202\323\344\223\0025\0223" + + "/v1beta1/{name=projects/*/locations/*/na" + + "mespaces/*}\332A\004name\022\354\001\n\017UpdateNamespace\022=" + + ".google.cloud.servicedirectory.v1beta1.U" + + "pdateNamespaceRequest\0320.google.cloud.ser" + + "vicedirectory.v1beta1.Namespace\"h\202\323\344\223\002J2" + + "=/v1beta1/{namespace.name=projects/*/loc" + + "ations/*/namespaces/*}:\tnamespace\332A\025name" + + "space,update_mask\022\254\001\n\017DeleteNamespace\022=." + + "google.cloud.servicedirectory.v1beta1.De" + + "leteNamespaceRequest\032\026.google.protobuf.E" + + "mpty\"B\202\323\344\223\0025*3/v1beta1/{name=projects/*/" + + "locations/*/namespaces/*}\332A\004name\022\351\001\n\rCre" + + "ateService\022;.google.cloud.servicedirecto" + + "ry.v1beta1.CreateServiceRequest\032..google" + + ".cloud.servicedirectory.v1beta1.Service\"" + + "k\202\323\344\223\002I\">/v1beta1/{parent=projects/*/loc" + + "ations/*/namespaces/*}/services:\007service" + + "\332A\031parent,service,service_id\022\330\001\n\014ListSer" + + "vices\022:.google.cloud.servicedirectory.v1" + + "beta1.ListServicesRequest\032;.google.cloud" + + ".servicedirectory.v1beta1.ListServicesRe" + + "sponse\"O\202\323\344\223\002@\022>/v1beta1/{parent=project" + + "s/*/locations/*/namespaces/*}/services\332A" + + "\006parent\022\305\001\n\nGetService\0228.google.cloud.se" + + "rvicedirectory.v1beta1.GetServiceRequest" + + "\032..google.cloud.servicedirectory.v1beta1" + + ".Service\"M\202\323\344\223\002@\022>/v1beta1/{name=project" + + "s/*/locations/*/namespaces/*/services/*}" + + "\332A\004name\022\353\001\n\rUpdateService\022;.google.cloud" + + ".servicedirectory.v1beta1.UpdateServiceR" + + "equest\032..google.cloud.servicedirectory.v" + + "1beta1.Service\"m\202\323\344\223\002Q2F/v1beta1/{servic" + + "e.name=projects/*/locations/*/namespaces" + + "/*/services/*}:\007service\332A\023service,update" + + "_mask\022\263\001\n\rDeleteService\022;.google.cloud.s" + + "ervicedirectory.v1beta1.DeleteServiceReq" + + "uest\032\026.google.protobuf.Empty\"M\202\323\344\223\002@*>/v" + + "1beta1/{name=projects/*/locations/*/name" + + "spaces/*/services/*}\332A\004name\022\373\001\n\016CreateEn" + + "dpoint\022<.google.cloud.servicedirectory.v" + + "1beta1.CreateEndpointRequest\032/.google.cl" + + "oud.servicedirectory.v1beta1.Endpoint\"z\202" + + "\323\344\223\002V\"J/v1beta1/{parent=projects/*/locat" + + "ions/*/namespaces/*/services/*}/endpoint" + + "s:\010endpoint\332A\033parent,endpoint,endpoint_i" + + "d\022\347\001\n\rListEndpoints\022;.google.cloud.servi" + + "cedirectory.v1beta1.ListEndpointsRequest" + + "\032<.google.cloud.servicedirectory.v1beta1" + + ".ListEndpointsResponse\"[\202\323\344\223\002L\022J/v1beta1" + + "/{parent=projects/*/locations/*/namespac" + + "es/*/services/*}/endpoints\332A\006parent\022\324\001\n\013" + + "GetEndpoint\0229.google.cloud.servicedirect" + + "ory.v1beta1.GetEndpointRequest\032/.google." + + "cloud.servicedirectory.v1beta1.Endpoint\"" + + "Y\202\323\344\223\002L\022J/v1beta1/{name=projects/*/locat" + + "ions/*/namespaces/*/services/*/endpoints" + + "/*}\332A\004name\022\375\001\n\016UpdateEndpoint\022<.google.c" + + "loud.servicedirectory.v1beta1.UpdateEndp" + + "ointRequest\032/.google.cloud.servicedirect" + + "ory.v1beta1.Endpoint\"|\202\323\344\223\002_2S/v1beta1/{" + + "endpoint.name=projects/*/locations/*/nam" + + "espaces/*/services/*/endpoints/*}:\010endpo" + + "int\332A\024endpoint,update_mask\022\301\001\n\016DeleteEnd" + + "point\022<.google.cloud.servicedirectory.v1" + + "beta1.DeleteEndpointRequest\032\026.google.pro" + + "tobuf.Empty\"Y\202\323\344\223\002L*J/v1beta1/{name=proj" + + "ects/*/locations/*/namespaces/*/services" + + "/*/endpoints/*}\332A\004name\022\362\001\n\014GetIamPolicy\022" + + "\".google.iam.v1.GetIamPolicyRequest\032\025.go" + + "ogle.iam.v1.Policy\"\246\001\202\323\344\223\002\237\001\"D/v1beta1/{" + + "resource=projects/*/locations/*/namespac" + + "es/*}:getIamPolicy:\001*ZT\"O/v1beta1/{resou" + + "rce=projects/*/locations/*/namespaces/*/" + + "services/*}:getIamPolicy:\001*\022\362\001\n\014SetIamPo" + + "licy\022\".google.iam.v1.SetIamPolicyRequest" + + "\032\025.google.iam.v1.Policy\"\246\001\202\323\344\223\002\237\001\"D/v1be" + + "ta1/{resource=projects/*/locations/*/nam" + + "espaces/*}:setIamPolicy:\001*ZT\"O/v1beta1/{" + + "resource=projects/*/locations/*/namespac" + + "es/*/services/*}:setIamPolicy:\001*\022\236\002\n\022Tes" + + "tIamPermissions\022(.google.iam.v1.TestIamP" + + "ermissionsRequest\032).google.iam.v1.TestIa" + + "mPermissionsResponse\"\262\001\202\323\344\223\002\253\001\"J/v1beta1" + + "/{resource=projects/*/locations/*/namesp" + + "aces/*}:testIamPermissions:\001*ZZ\"U/v1beta" + + "1/{resource=projects/*/locations/*/names" + + "paces/*/services/*}:testIamPermissions:\001" + + "*\032S\312A\037servicedirectory.googleapis.com\322A." + + "https://www.googleapis.com/auth/cloud-pl" + + "atformB\241\001\n)com.google.cloud.servicedirec" + + "tory.v1beta1B\030RegistrationServiceProtoP\001" + + "ZUgoogle.golang.org/genproto/googleapis/" + + "cloud/servicedirectory/v1beta1;servicedi" + + "rectory\370\001\001b\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.servicedirectory.v1beta1.EndpointProto.getDescriptor(), + com.google.cloud.servicedirectory.v1beta1.NamespaceProto.getDescriptor(), + com.google.cloud.servicedirectory.v1beta1.ServiceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_CreateNamespaceRequest_descriptor, + new java.lang.String[] { + "Parent", "NamespaceId", "Namespace", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ListNamespacesResponse_descriptor, + new java.lang.String[] { + "Namespaces", "NextPageToken", + }); + internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_GetNamespaceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_descriptor, + new java.lang.String[] { + "Namespace", "UpdateMask", + }); + internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_DeleteNamespaceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_CreateServiceRequest_descriptor, + new java.lang.String[] { + "Parent", "ServiceId", "Service", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ListServicesResponse_descriptor, + new java.lang.String[] { + "Services", "NextPageToken", + }); + internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_GetServiceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_descriptor, + new java.lang.String[] { + "Service", "UpdateMask", + }); + internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_DeleteServiceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_CreateEndpointRequest_descriptor, + new java.lang.String[] { + "Parent", "EndpointId", "Endpoint", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_ListEndpointsResponse_descriptor, + new java.lang.String[] { + "Endpoints", "NextPageToken", + }); + internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_GetEndpointRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_descriptor, + new java.lang.String[] { + "Endpoint", "UpdateMask", + }); + internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_DeleteEndpointRequest_descriptor, + new java.lang.String[] { + "Name", + }); + 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); + 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.servicedirectory.v1beta1.EndpointProto.getDescriptor(); + com.google.cloud.servicedirectory.v1beta1.NamespaceProto.getDescriptor(); + com.google.cloud.servicedirectory.v1beta1.ServiceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequest.java new file mode 100644 index 00000000..cd36fa29 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequest.java @@ -0,0 +1,1036 @@ +/* + * 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/servicedirectory/v1beta1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService].
+ * Looks up a service by its name, returns the service and its endpoints.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ResolveServiceRequest} + */ +public final class ResolveServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) + ResolveServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResolveServiceRequest.newBuilder() to construct. + private ResolveServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResolveServiceRequest() { + name_ = ""; + endpointFilter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResolveServiceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResolveServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + maxEndpoints_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + endpointFilter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the service to resolve.
+   * 
+ * + * + * 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) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to resolve.
+   * 
+ * + * + * 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 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 MAX_ENDPOINTS_FIELD_NUMBER = 2; + private int maxEndpoints_; + /** + * + * + *
+   * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100.
+   * If a value less than one is specified, the Default is used.
+   * If a value greater than the Maximum is specified, the Maximum is used.
+   * 
+ * + * int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The maxEndpoints. + */ + public int getMaxEndpoints() { + return maxEndpoints_; + } + + public static final int ENDPOINT_FILTER_FIELD_NUMBER = 3; + private volatile java.lang.Object endpointFilter_; + /** + * + * + *
+   * Optional. The filter applied to the endpoints of the resolved service.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+   * roughly the same as "=".
+   * <value> must be the same data type as the field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the
+   *   key "owner", this is the same as "metadata:owner"
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC"
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns
+   *   Endpoints that have "owner" field in metadata with a value that is not
+   *   "sd" AND have the key/value foo=bar.
+   * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The endpointFilter. + */ + public java.lang.String getEndpointFilter() { + java.lang.Object ref = endpointFilter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointFilter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The filter applied to the endpoints of the resolved service.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+   * roughly the same as "=".
+   * <value> must be the same data type as the field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the
+   *   key "owner", this is the same as "metadata:owner"
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC"
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns
+   *   Endpoints that have "owner" field in metadata with a value that is not
+   *   "sd" AND have the key/value foo=bar.
+   * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for endpointFilter. + */ + public com.google.protobuf.ByteString getEndpointFilterBytes() { + java.lang.Object ref = endpointFilter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpointFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (maxEndpoints_ != 0) { + output.writeInt32(2, maxEndpoints_); + } + if (!getEndpointFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, endpointFilter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (maxEndpoints_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxEndpoints_); + } + if (!getEndpointFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, endpointFilter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest other = + (com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getMaxEndpoints() != other.getMaxEndpoints()) return false; + if (!getEndpointFilter().equals(other.getEndpointFilter())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + MAX_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getMaxEndpoints(); + hash = (37 * hash) + ENDPOINT_FILTER_FIELD_NUMBER; + hash = (53 * hash) + getEndpointFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest 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.servicedirectory.v1beta1.ResolveServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest 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.servicedirectory.v1beta1.ResolveServiceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest 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.servicedirectory.v1beta1.ResolveServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest 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.servicedirectory.v1beta1.ResolveServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest 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.servicedirectory.v1beta1.ResolveServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService].
+   * Looks up a service by its name, returns the service and its endpoints.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ResolveServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + maxEndpoints_ = 0; + + endpointFilter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest build() { + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest result = + new com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest(this); + result.name_ = name_; + result.maxEndpoints_ = maxEndpoints_; + result.endpointFilter_ = endpointFilter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getMaxEndpoints() != 0) { + setMaxEndpoints(other.getMaxEndpoints()); + } + if (!other.getEndpointFilter().isEmpty()) { + endpointFilter_ = other.endpointFilter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the service to resolve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to resolve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to resolve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to resolve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to resolve.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int maxEndpoints_; + /** + * + * + *
+     * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100.
+     * If a value less than one is specified, the Default is used.
+     * If a value greater than the Maximum is specified, the Maximum is used.
+     * 
+ * + * int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The maxEndpoints. + */ + public int getMaxEndpoints() { + return maxEndpoints_; + } + /** + * + * + *
+     * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100.
+     * If a value less than one is specified, the Default is used.
+     * If a value greater than the Maximum is specified, the Maximum is used.
+     * 
+ * + * int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The maxEndpoints to set. + * @return This builder for chaining. + */ + public Builder setMaxEndpoints(int value) { + + maxEndpoints_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100.
+     * If a value less than one is specified, the Default is used.
+     * If a value greater than the Maximum is specified, the Maximum is used.
+     * 
+ * + * int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearMaxEndpoints() { + + maxEndpoints_ = 0; + onChanged(); + return this; + } + + private java.lang.Object endpointFilter_ = ""; + /** + * + * + *
+     * Optional. The filter applied to the endpoints of the resolved service.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+     * roughly the same as "=".
+     * <value> must be the same data type as the field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the
+     *   key "owner", this is the same as "metadata:owner"
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC"
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns
+     *   Endpoints that have "owner" field in metadata with a value that is not
+     *   "sd" AND have the key/value foo=bar.
+     * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The endpointFilter. + */ + public java.lang.String getEndpointFilter() { + java.lang.Object ref = endpointFilter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + endpointFilter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The filter applied to the endpoints of the resolved service.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+     * roughly the same as "=".
+     * <value> must be the same data type as the field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the
+     *   key "owner", this is the same as "metadata:owner"
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC"
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns
+     *   Endpoints that have "owner" field in metadata with a value that is not
+     *   "sd" AND have the key/value foo=bar.
+     * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for endpointFilter. + */ + public com.google.protobuf.ByteString getEndpointFilterBytes() { + java.lang.Object ref = endpointFilter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + endpointFilter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The filter applied to the endpoints of the resolved service.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+     * roughly the same as "=".
+     * <value> must be the same data type as the field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the
+     *   key "owner", this is the same as "metadata:owner"
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC"
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns
+     *   Endpoints that have "owner" field in metadata with a value that is not
+     *   "sd" AND have the key/value foo=bar.
+     * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The endpointFilter to set. + * @return This builder for chaining. + */ + public Builder setEndpointFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + endpointFilter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter applied to the endpoints of the resolved service.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+     * roughly the same as "=".
+     * <value> must be the same data type as the field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the
+     *   key "owner", this is the same as "metadata:owner"
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC"
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns
+     *   Endpoints that have "owner" field in metadata with a value that is not
+     *   "sd" AND have the key/value foo=bar.
+     * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEndpointFilter() { + + endpointFilter_ = getDefaultInstance().getEndpointFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The filter applied to the endpoints of the resolved service.
+     * General filter string syntax:
+     * <field> <operator> <value> (<logical connector>)
+     * <field> can be "name" or "metadata.<key>" for map field.
+     * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+     * roughly the same as "=".
+     * <value> must be the same data type as the field.
+     * <logical connector> can be "AND, OR, NOT".
+     * Examples of valid filters:
+     * * "metadata.owner" returns Endpoints that have a label with the
+     *   key "owner", this is the same as "metadata:owner"
+     * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+     *   "protocol=gRPC"
+     * * "metadata.owner!=sd AND metadata.foo=bar" returns
+     *   Endpoints that have "owner" field in metadata with a value that is not
+     *   "sd" AND have the key/value foo=bar.
+     * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for endpointFilter to set. + * @return This builder for chaining. + */ + public Builder setEndpointFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + endpointFilter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResolveServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResolveServiceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequestOrBuilder.java new file mode 100644 index 00000000..240c387d --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceRequestOrBuilder.java @@ -0,0 +1,124 @@ +/* + * 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/servicedirectory/v1beta1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ResolveServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ResolveServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the service to resolve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the service to resolve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100.
+   * If a value less than one is specified, the Default is used.
+   * If a value greater than the Maximum is specified, the Maximum is used.
+   * 
+ * + * int32 max_endpoints = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The maxEndpoints. + */ + int getMaxEndpoints(); + + /** + * + * + *
+   * Optional. The filter applied to the endpoints of the resolved service.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+   * roughly the same as "=".
+   * <value> must be the same data type as the field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the
+   *   key "owner", this is the same as "metadata:owner"
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC"
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns
+   *   Endpoints that have "owner" field in metadata with a value that is not
+   *   "sd" AND have the key/value foo=bar.
+   * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The endpointFilter. + */ + java.lang.String getEndpointFilter(); + /** + * + * + *
+   * Optional. The filter applied to the endpoints of the resolved service.
+   * General filter string syntax:
+   * <field> <operator> <value> (<logical connector>)
+   * <field> can be "name" or "metadata.<key>" for map field.
+   * <operator> can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is
+   * roughly the same as "=".
+   * <value> must be the same data type as the field.
+   * <logical connector> can be "AND, OR, NOT".
+   * Examples of valid filters:
+   * * "metadata.owner" returns Endpoints that have a label with the
+   *   key "owner", this is the same as "metadata:owner"
+   * * "metadata.protocol=gRPC" returns Endpoints that have key/value
+   *   "protocol=gRPC"
+   * * "metadata.owner!=sd AND metadata.foo=bar" returns
+   *   Endpoints that have "owner" field in metadata with a value that is not
+   *   "sd" AND have the key/value foo=bar.
+   * 
+ * + * string endpoint_filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for endpointFilter. + */ + com.google.protobuf.ByteString getEndpointFilterBytes(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponse.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponse.java new file mode 100644 index 00000000..7fb395a1 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponse.java @@ -0,0 +1,652 @@ +/* + * 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/servicedirectory/v1beta1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The response message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ResolveServiceResponse} + */ +public final class ResolveServiceResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) + ResolveServiceResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResolveServiceResponse.newBuilder() to construct. + private ResolveServiceResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResolveServiceResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResolveServiceResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResolveServiceResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.servicedirectory.v1beta1.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Service.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(service_); + service_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.class, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1beta1.Service service_; + /** + * .google.cloud.servicedirectory.v1beta1.Service service = 1; + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return service_ != null; + } + /** + * .google.cloud.servicedirectory.v1beta1.Service service = 1; + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1beta1.Service getService() { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder() { + return getService(); + } + + 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 (service_ != null) { + output.writeMessage(1, getService()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (service_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getService()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse other = + (com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) obj; + + if (hasService() != other.hasService()) return false; + if (hasService()) { + if (!getService().equals(other.getService())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasService()) { + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse 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.servicedirectory.v1beta1.ResolveServiceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse 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.servicedirectory.v1beta1.ResolveServiceResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse 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.servicedirectory.v1beta1.ResolveServiceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse 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.servicedirectory.v1beta1.ResolveServiceResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse 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.servicedirectory.v1beta1.ResolveServiceResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.ResolveServiceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.class, + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceBuilder_ == null) { + service_ = null; + } else { + service_ = null; + serviceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_ResolveServiceResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse build() { + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse buildPartial() { + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse result = + new com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse(this); + if (serviceBuilder_ == null) { + result.service_ = service_; + } else { + result.service_ = serviceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse.getDefaultInstance()) + return this; + if (other.hasService()) { + mergeService(other.getService()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + serviceBuilder_; + /** + * .google.cloud.servicedirectory.v1beta1.Service service = 1; + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return serviceBuilder_ != null || service_ != null; + } + /** + * .google.cloud.servicedirectory.v1beta1.Service service = 1; + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1beta1.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public Builder setService(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + + return this; + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public Builder setService( + com.google.cloud.servicedirectory.v1beta1.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public Builder mergeService(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.cloud.servicedirectory.v1beta1.Service.newBuilder(service_) + .mergeFrom(value) + .buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + service_ = null; + serviceBuilder_ = null; + } + + return this; + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public com.google.cloud.servicedirectory.v1beta1.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } + } + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder>( + getService(), getParentForChildren(), isClean()); + service_ = null; + } + return serviceBuilder_; + } + + @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.servicedirectory.v1beta1.ResolveServiceResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) + private static final com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse(); + } + + public static com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResolveServiceResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResolveServiceResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.ResolveServiceResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponseOrBuilder.java new file mode 100644 index 00000000..d1666bdc --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ResolveServiceResponseOrBuilder.java @@ -0,0 +1,40 @@ +/* + * 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/servicedirectory/v1beta1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ResolveServiceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.ResolveServiceResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.cloud.servicedirectory.v1beta1.Service service = 1; + * + * @return Whether the service field is set. + */ + boolean hasService(); + /** + * .google.cloud.servicedirectory.v1beta1.Service service = 1; + * + * @return The service. + */ + com.google.cloud.servicedirectory.v1beta1.Service getService(); + /** .google.cloud.servicedirectory.v1beta1.Service service = 1; */ + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Service.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Service.java new file mode 100644 index 00000000..77551c05 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/Service.java @@ -0,0 +1,1568 @@ +/* + * 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/servicedirectory/v1beta1/service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * An individual service. A service contains a name and optional metadata.
+ * A service must exist before
+ * [endpoints][google.cloud.servicedirectory.v1beta1.Endpoint] can be
+ * added to it.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.Service} + */ +public final class Service extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.Service) + ServiceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Service.newBuilder() to construct. + private Service(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Service() { + name_ = ""; + endpoints_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Service(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Service( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + endpoints_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + endpoints_.add( + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Endpoint.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Service_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.Service.class, + com.google.cloud.servicedirectory.v1beta1.Service.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The resource name for the service in the format
+   * 'projects/*/locations/*/namespaces/*/services/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + 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; + } + } + /** + * + * + *
+   * Immutable. The resource name for the service in the format
+   * 'projects/*/locations/*/namespaces/*/services/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + 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 METADATA_FIELD_NUMBER = 2; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.servicedirectory.v1beta1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Service_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ENDPOINTS_FIELD_NUMBER = 3; + private java.util.List endpoints_; + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEndpointsOrBuilderList() { + return endpoints_; + } + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointsOrBuilder( + int index) { + return endpoints_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 2); + for (int i = 0; i < endpoints_.size(); i++) { + output.writeMessage(3, endpoints_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, metadata__); + } + for (int i = 0; i < endpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, endpoints_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.Service)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.Service other = + (com.google.cloud.servicedirectory.v1beta1.Service) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.Service parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service 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.servicedirectory.v1beta1.Service parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service 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.servicedirectory.v1beta1.Service parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service 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.servicedirectory.v1beta1.Service parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service 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.servicedirectory.v1beta1.Service parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service 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.servicedirectory.v1beta1.Service prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * An individual service. A service contains a name and optional metadata.
+   * A service must exist before
+   * [endpoints][google.cloud.servicedirectory.v1beta1.Endpoint] can be
+   * added to it.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.Service} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.Service) + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Service_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.Service.class, + com.google.cloud.servicedirectory.v1beta1.Service.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.Service.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEndpointsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + internalGetMutableMetadata().clear(); + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + endpointsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_Service_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Service getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Service build() { + com.google.cloud.servicedirectory.v1beta1.Service result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Service buildPartial() { + com.google.cloud.servicedirectory.v1beta1.Service result = + new com.google.cloud.servicedirectory.v1beta1.Service(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + if (endpointsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.endpoints_ = endpoints_; + } else { + result.endpoints_ = endpointsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.Service) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.Service) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.Service other) { + if (other == com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + if (endpointsBuilder_ == null) { + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + } else { + if (!other.endpoints_.isEmpty()) { + if (endpointsBuilder_.isEmpty()) { + endpointsBuilder_.dispose(); + endpointsBuilder_ = null; + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00000002); + endpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndpointsFieldBuilder() + : null; + } else { + endpointsBuilder_.addAllMessages(other.endpoints_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.Service parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.Service) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The resource name for the service in the format
+     * 'projects/*/locations/*/namespaces/*/services/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name for the service in the format
+     * 'projects/*/locations/*/namespaces/*/services/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The resource name for the service in the format
+     * 'projects/*/locations/*/namespaces/*/services/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name for the service in the format
+     * 'projects/*/locations/*/namespaces/*/services/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource name for the service in the format
+     * 'projects/*/locations/*/namespaces/*/services/*'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putMetadata(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Metadata for the service. This data can be consumed by service
+     * clients.  The entire metadata dictionary may contain up to 2000 characters,
+     * spread across all key-value pairs. Metadata that goes beyond any these
+     * limits will be rejected.
+     * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllMetadata(java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + return this; + } + + private java.util.List endpoints_ = + java.util.Collections.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + endpoints_ = + new java.util.ArrayList(endpoints_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEndpointsList() { + if (endpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endpoints_); + } else { + return endpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEndpointsCount() { + if (endpointsBuilder_ == null) { + return endpoints_.size(); + } else { + return endpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoints(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints(com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + } else { + endpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(index, value); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints( + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints( + int index, com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllEndpoints( + java.lang.Iterable values) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + onChanged(); + } else { + endpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndpoints() { + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + endpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeEndpoints(int index) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.remove(index); + onChanged(); + } else { + endpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder getEndpointsBuilder( + int index) { + return getEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointsOrBuilder( + int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEndpointsOrBuilderList() { + if (endpointsBuilder_ != null) { + return endpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endpoints_); + } + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder addEndpointsBuilder( + int index) { + return getEndpointsFieldBuilder() + .addBuilder( + index, com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+     * Control plane clients should use RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEndpointsBuilderList() { + return getEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder>( + endpoints_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + endpoints_ = null; + } + return endpointsBuilder_; + } + + @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.servicedirectory.v1beta1.Service) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.Service) + private static final com.google.cloud.servicedirectory.v1beta1.Service DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.Service(); + } + + public static com.google.cloud.servicedirectory.v1beta1.Service getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Service parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Service(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.Service getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceName.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceName.java new file mode 100644 index 00000000..07b12400 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceName.java @@ -0,0 +1,242 @@ +/* + * 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.servicedirectory.v1beta1; + +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; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ServiceName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String namespace; + private final String service; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNamespace() { + return namespace; + } + + public String getService() { + return service; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ServiceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + namespace = Preconditions.checkNotNull(builder.getNamespace()); + service = Preconditions.checkNotNull(builder.getService()); + } + + public static ServiceName of(String project, String location, String namespace, String service) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setNamespace(namespace) + .setService(service) + .build(); + } + + public static String format(String project, String location, String namespace, String service) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setNamespace(namespace) + .setService(service) + .build() + .toString(); + } + + public static ServiceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ServiceName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("namespace"), + matchMap.get("service")); + } + + 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 (ServiceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("namespace", namespace); + fieldMapBuilder.put("service", service); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "namespace", namespace, "service", service); + } + + /** Builder for ServiceName. */ + public static class Builder { + + private String project; + private String location; + private String namespace; + private String service; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getNamespace() { + return namespace; + } + + public String getService() { + return service; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + private Builder() {} + + private Builder(ServiceName serviceName) { + project = serviceName.project; + location = serviceName.location; + namespace = serviceName.namespace; + service = serviceName.service; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ServiceName) { + ServiceName that = (ServiceName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.namespace.equals(that.namespace)) + && (this.service.equals(that.service)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= namespace.hashCode(); + h *= 1000003; + h ^= service.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceOrBuilder.java new file mode 100644 index 00000000..cad725f9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceOrBuilder.java @@ -0,0 +1,188 @@ +/* + * 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/servicedirectory/v1beta1/service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface ServiceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.Service) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The resource name for the service in the format
+   * 'projects/*/locations/*/namespaces/*/services/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The resource name for the service in the format
+   * 'projects/*/locations/*/namespaces/*/services/*'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getMetadataCount(); + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Metadata for the service. This data can be consumed by service
+   * clients.  The entire metadata dictionary may contain up to 2000 characters,
+   * spread across all key-value pairs. Metadata that goes beyond any these
+   * limits will be rejected.
+   * 
+ * + * map<string, string> metadata = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getMetadataOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoints(int index); + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getEndpointsCount(); + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getEndpointsOrBuilderList(); + /** + * + * + *
+   * Output only. Endpoints associated with this service. Returned on LookupService.Resolve.
+   * Control plane clients should use RegistrationService.ListEndpoints.
+   * 
+ * + * + * repeated .google.cloud.servicedirectory.v1beta1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointsOrBuilder(int index); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceProto.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceProto.java new file mode 100644 index 00000000..08cf7865 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/ServiceProto.java @@ -0,0 +1,108 @@ +/* + * 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/servicedirectory/v1beta1/service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public final class ServiceProto { + private ServiceProto() {} + + 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_servicedirectory_v1beta1_Service_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_Service_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1beta1_Service_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1beta1_Service_MetadataEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/servicedirectory/v1beta1/" + + "service.proto\022%google.cloud.servicedirec" + + "tory.v1beta1\032\037google/api/field_behavior." + + "proto\032\031google/api/resource.proto\0324google" + + "/cloud/servicedirectory/v1beta1/endpoint" + + ".proto\032\034google/api/annotations.proto\"\354\002\n" + + "\007Service\022\021\n\004name\030\001 \001(\tB\003\340A\005\022S\n\010metadata\030" + + "\002 \003(\0132<.google.cloud.servicedirectory.v1" + + "beta1.Service.MetadataEntryB\003\340A\001\022G\n\tendp" + + "oints\030\003 \003(\0132/.google.cloud.servicedirect" + + "ory.v1beta1.EndpointB\003\340A\003\032/\n\rMetadataEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\177\352A|\n" + + "\'servicedirectory.googleapis.com/Service" + + "\022Qprojects/{project}/locations/{location" + + "}/namespaces/{namespace}/services/{servi" + + "ce}B\225\001\n)com.google.cloud.servicedirector" + + "y.v1beta1B\014ServiceProtoP\001ZUgoogle.golang" + + ".org/genproto/googleapis/cloud/servicedi" + + "rectory/v1beta1;servicedirectory\370\001\001b\006pro" + + "to3" + }; + 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.cloud.servicedirectory.v1beta1.EndpointProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1beta1_Service_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1beta1_Service_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_Service_descriptor, + new java.lang.String[] { + "Name", "Metadata", "Endpoints", + }); + internal_static_google_cloud_servicedirectory_v1beta1_Service_MetadataEntry_descriptor = + internal_static_google_cloud_servicedirectory_v1beta1_Service_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_servicedirectory_v1beta1_Service_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1beta1_Service_MetadataEntry_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.cloud.servicedirectory.v1beta1.EndpointProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequest.java new file mode 100644 index 00000000..5b807aa2 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequest.java @@ -0,0 +1,1045 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest} + */ +public final class UpdateEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) + UpdateEndpointRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateEndpointRequest.newBuilder() to construct. + private UpdateEndpointRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateEndpointRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateEndpointRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateEndpointRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder subBuilder = null; + if (endpoint_ != null) { + subBuilder = endpoint_.toBuilder(); + } + endpoint_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Endpoint.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endpoint_); + endpoint_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1beta1.Endpoint endpoint_; + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + public boolean hasEndpoint() { + return endpoint_ != null; + } + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint() { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance() + : endpoint_; + } + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointOrBuilder() { + return getEndpoint(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (endpoint_ != null) { + output.writeMessage(1, getEndpoint()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (endpoint_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEndpoint()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest other = + (com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) obj; + + if (hasEndpoint() != other.hasEndpoint()) return false; + if (hasEndpoint()) { + if (!getEndpoint().equals(other.getEndpoint())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEndpoint()) { + hash = (37 * hash) + ENDPOINT_FIELD_NUMBER; + hash = (53 * hash) + getEndpoint().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest 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.servicedirectory.v1beta1.UpdateEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest 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.servicedirectory.v1beta1.UpdateEndpointRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest 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.servicedirectory.v1beta1.UpdateEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest 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.servicedirectory.v1beta1.UpdateEndpointRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest 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.servicedirectory.v1beta1.UpdateEndpointRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.class, + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (endpointBuilder_ == null) { + endpoint_ = null; + } else { + endpoint_ = null; + endpointBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest build() { + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest result = + new com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest(this); + if (endpointBuilder_ == null) { + result.endpoint_ = endpoint_; + } else { + result.endpoint_ = endpointBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest.getDefaultInstance()) + return this; + if (other.hasEndpoint()) { + mergeEndpoint(other.getEndpoint()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Endpoint endpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + endpointBuilder_; + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + public boolean hasEndpoint() { + return endpointBuilder_ != null || endpoint_ != null; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint() { + if (endpointBuilder_ == null) { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance() + : endpoint_; + } else { + return endpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endpoint_ = value; + onChanged(); + } else { + endpointBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint( + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + endpoint_ = builderForValue.build(); + onChanged(); + } else { + endpointBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEndpoint(com.google.cloud.servicedirectory.v1beta1.Endpoint value) { + if (endpointBuilder_ == null) { + if (endpoint_ != null) { + endpoint_ = + com.google.cloud.servicedirectory.v1beta1.Endpoint.newBuilder(endpoint_) + .mergeFrom(value) + .buildPartial(); + } else { + endpoint_ = value; + } + onChanged(); + } else { + endpointBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEndpoint() { + if (endpointBuilder_ == null) { + endpoint_ = null; + onChanged(); + } else { + endpoint_ = null; + endpointBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder getEndpointBuilder() { + + onChanged(); + return getEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointOrBuilder() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilder(); + } else { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1beta1.Endpoint.getDefaultInstance() + : endpoint_; + } + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Endpoint, + com.google.cloud.servicedirectory.v1beta1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder>( + getEndpoint(), getParentForChildren(), isClean()); + endpoint_ = null; + } + return endpointBuilder_; + } + + 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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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_; + } + + @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.servicedirectory.v1beta1.UpdateEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) + private static final com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateEndpointRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateEndpointRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequestOrBuilder.java new file mode 100644 index 00000000..46721f40 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateEndpointRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface UpdateEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + boolean hasEndpoint(); + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + com.google.cloud.servicedirectory.v1beta1.Endpoint getEndpoint(); + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1beta1.EndpointOrBuilder getEndpointOrBuilder(); + + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequest.java new file mode 100644 index 00000000..04eadb4e --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequest.java @@ -0,0 +1,1045 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest} + */ +public final class UpdateNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) + UpdateNamespaceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateNamespaceRequest.newBuilder() to construct. + private UpdateNamespaceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateNamespaceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateNamespaceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateNamespaceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder subBuilder = null; + if (namespace_ != null) { + subBuilder = namespace_.toBuilder(); + } + namespace_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Namespace.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(namespace_); + namespace_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.Builder.class); + } + + public static final int NAMESPACE_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1beta1.Namespace namespace_; + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + public boolean hasNamespace() { + return namespace_ != null; + } + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace() { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance() + : namespace_; + } + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespaceOrBuilder() { + return getNamespace(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (namespace_ != null) { + output.writeMessage(1, getNamespace()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (namespace_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getNamespace()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest other = + (com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) obj; + + if (hasNamespace() != other.hasNamespace()) return false; + if (hasNamespace()) { + if (!getNamespace().equals(other.getNamespace())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNamespace()) { + hash = (37 * hash) + NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getNamespace().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest 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.servicedirectory.v1beta1.UpdateNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest 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.servicedirectory.v1beta1.UpdateNamespaceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest 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.servicedirectory.v1beta1.UpdateNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest 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.servicedirectory.v1beta1.UpdateNamespaceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest 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.servicedirectory.v1beta1.UpdateNamespaceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (namespaceBuilder_ == null) { + namespace_ = null; + } else { + namespace_ = null; + namespaceBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest build() { + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest result = + new com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest(this); + if (namespaceBuilder_ == null) { + result.namespace_ = namespace_; + } else { + result.namespace_ = namespaceBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest.getDefaultInstance()) + return this; + if (other.hasNamespace()) { + mergeNamespace(other.getNamespace()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Namespace namespace_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder> + namespaceBuilder_; + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + public boolean hasNamespace() { + return namespaceBuilder_ != null || namespace_ != null; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace() { + if (namespaceBuilder_ == null) { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance() + : namespace_; + } else { + return namespaceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace(com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespaceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + namespace_ = value; + onChanged(); + } else { + namespaceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace( + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder builderForValue) { + if (namespaceBuilder_ == null) { + namespace_ = builderForValue.build(); + onChanged(); + } else { + namespaceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNamespace(com.google.cloud.servicedirectory.v1beta1.Namespace value) { + if (namespaceBuilder_ == null) { + if (namespace_ != null) { + namespace_ = + com.google.cloud.servicedirectory.v1beta1.Namespace.newBuilder(namespace_) + .mergeFrom(value) + .buildPartial(); + } else { + namespace_ = value; + } + onChanged(); + } else { + namespaceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearNamespace() { + if (namespaceBuilder_ == null) { + namespace_ = null; + onChanged(); + } else { + namespace_ = null; + namespaceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Namespace.Builder getNamespaceBuilder() { + + onChanged(); + return getNamespaceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespaceOrBuilder() { + if (namespaceBuilder_ != null) { + return namespaceBuilder_.getMessageOrBuilder(); + } else { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1beta1.Namespace.getDefaultInstance() + : namespace_; + } + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder> + getNamespaceFieldBuilder() { + if (namespaceBuilder_ == null) { + namespaceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Namespace, + com.google.cloud.servicedirectory.v1beta1.Namespace.Builder, + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder>( + getNamespace(), getParentForChildren(), isClean()); + namespace_ = null; + } + return namespaceBuilder_; + } + + 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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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_; + } + + @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.servicedirectory.v1beta1.UpdateNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateNamespaceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateNamespaceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..ec289f64 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateNamespaceRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface UpdateNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + boolean hasNamespace(); + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + com.google.cloud.servicedirectory.v1beta1.Namespace getNamespace(); + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1beta1.NamespaceOrBuilder getNamespaceOrBuilder(); + + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequest.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequest.java new file mode 100644 index 00000000..bfc984ce --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequest.java @@ -0,0 +1,1044 @@ +/* + * 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/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +/** + * + * + *
+ * The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.UpdateServiceRequest} + */ +public final class UpdateServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) + UpdateServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateServiceRequest.newBuilder() to construct. + private UpdateServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateServiceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateServiceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.servicedirectory.v1beta1.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + com.google.cloud.servicedirectory.v1beta1.Service.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(service_); + service_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1beta1.Service service_; + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return service_ != null; + } + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1beta1.Service getService() { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder() { + return getService(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (service_ != null) { + output.writeMessage(1, getService()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (service_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getService()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest other = + (com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) obj; + + if (hasService() != other.hasService()) return false; + if (hasService()) { + if (!getService().equals(other.getService())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasService()) { + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest 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.servicedirectory.v1beta1.UpdateServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest 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.servicedirectory.v1beta1.UpdateServiceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest 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.servicedirectory.v1beta1.UpdateServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest 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.servicedirectory.v1beta1.UpdateServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest 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.servicedirectory.v1beta1.UpdateServiceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1beta1.UpdateServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.class, + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (serviceBuilder_ == null) { + service_ = null; + } else { + service_ = null; + serviceBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1beta1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1beta1_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest + getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest build() { + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest result = + new com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest(this); + if (serviceBuilder_ == null) { + result.service_ = service_; + } else { + result.service_ = serviceBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest other) { + if (other + == com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest.getDefaultInstance()) + return this; + if (other.hasService()) { + mergeService(other.getService()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1beta1.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + serviceBuilder_; + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return serviceBuilder_ != null || service_ != null; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1beta1.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService( + com.google.cloud.servicedirectory.v1beta1.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeService(com.google.cloud.servicedirectory.v1beta1.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.cloud.servicedirectory.v1beta1.Service.newBuilder(service_) + .mergeFrom(value) + .buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + service_ = null; + serviceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? com.google.cloud.servicedirectory.v1beta1.Service.getDefaultInstance() + : service_; + } + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1beta1.Service, + com.google.cloud.servicedirectory.v1beta1.Service.Builder, + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder>( + getService(), getParentForChildren(), isClean()); + service_ = null; + } + return serviceBuilder_; + } + + 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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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. List of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.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_; + } + + @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.servicedirectory.v1beta1.UpdateServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) + private static final com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateServiceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequestOrBuilder.java new file mode 100644 index 00000000..f4faf6e9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/UpdateServiceRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1beta1/registration_service.proto + +package com.google.cloud.servicedirectory.v1beta1; + +public interface UpdateServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1beta1.UpdateServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + boolean hasService(); + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + com.google.cloud.servicedirectory.v1beta1.Service getService(); + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1beta1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1beta1.ServiceOrBuilder getServiceOrBuilder(); + + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. List of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/endpoint.proto b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/endpoint.proto new file mode 100644 index 00000000..c5bf6896 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/endpoint.proto @@ -0,0 +1,60 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.servicedirectory.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1beta1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "EndpointProto"; +option java_package = "com.google.cloud.servicedirectory.v1beta1"; + +// An individual endpoint that provides a +// [service][google.cloud.servicedirectory.v1beta1.Service]. The service must +// already exist to create an endpoint. +message Endpoint { + option (google.api.resource) = { + type: "servicedirectory.googleapis.com/Endpoint" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}/endpoints/{endpoint}" + }; + + // Immutable. The resource name for the endpoint in the format + // 'projects/*/locations/*/namespaces/*/services/*/endpoints/*'. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. An IPv4 or IPv6 address. Service Directory will reject bad + // addresses like: + // "8.8.8" + // "8.8.8.8:53" + // "test:bad:address" + // "[::1]" + // "[::1]:8080" + // Limited to 45 characters. + string address = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service Directory will reject values outside of [0, 65535]. + int32 port = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata for the endpoint. This data can be consumed by service + // clients. The entire metadata dictionary may contain up to 512 characters, + // spread accoss all key-value pairs. Metadata that goes beyond any these + // limits will be rejected. + map metadata = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/lookup_service.proto b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/lookup_service.proto new file mode 100644 index 00000000..5f439108 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/lookup_service.proto @@ -0,0 +1,87 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.servicedirectory.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/servicedirectory/v1beta1/service.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1beta1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "LookupServiceProto"; +option java_package = "com.google.cloud.servicedirectory.v1beta1"; + +// Service Directory API for looking up service data at runtime. +service LookupService { + option (google.api.default_host) = "servicedirectory.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its + // associated endpoints. + // Resolving a service is not considered an active developer method. + rpc ResolveService(ResolveServiceRequest) returns (ResolveServiceResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve" + body: "*" + }; + } +} + +// The request message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. +// Looks up a service by its name, returns the service and its endpoints. +message ResolveServiceRequest { + // Required. The name of the service to resolve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + + // Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. + // If a value less than one is specified, the Default is used. + // If a value greater than the Maximum is specified, the Maximum is used. + int32 max_endpoints = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter applied to the endpoints of the resolved service. + // + // General filter string syntax: + // () + // can be "name" or "metadata." for map field. + // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS and is + // roughly the same as "=". + // must be the same data type as the field. + // can be "AND, OR, NOT". + // + // Examples of valid filters: + // * "metadata.owner" returns Endpoints that have a label with the + // key "owner", this is the same as "metadata:owner" + // * "metadata.protocol=gRPC" returns Endpoints that have key/value + // "protocol=gRPC" + // * "metadata.owner!=sd AND metadata.foo=bar" returns + // Endpoints that have "owner" field in metadata with a value that is not + // "sd" AND have the key/value foo=bar. + string endpoint_filter = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. +message ResolveServiceResponse { + Service service = 1; +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/namespace.proto b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/namespace.proto new file mode 100644 index 00000000..e86f56b9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/namespace.proto @@ -0,0 +1,46 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.servicedirectory.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1beta1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "NamespaceProto"; +option java_package = "com.google.cloud.servicedirectory.v1beta1"; + +// A container for [services][google.cloud.servicedirectory.v1beta1.Service]. +// Namespaces allow administrators to group services together and define +// permissions for a collection of services. +message Namespace { + option (google.api.resource) = { + type: "servicedirectory.googleapis.com/Namespace" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}" + }; + + // Immutable. The resource name for the namespace in the format + // 'projects/*/locations/*/namespaces/*'. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Resource labels associated with this Namespace. + // No more than 64 user labels can be associated with a given resource. Label + // keys and values can be no longer than 63 characters. + map labels = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/registration_service.proto b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/registration_service.proto new file mode 100644 index 00000000..156030e8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/registration_service.proto @@ -0,0 +1,566 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.servicedirectory.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/servicedirectory/v1beta1/endpoint.proto"; +import "google/cloud/servicedirectory/v1beta1/namespace.proto"; +import "google/cloud/servicedirectory/v1beta1/service.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1beta1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "RegistrationServiceProto"; +option java_package = "com.google.cloud.servicedirectory.v1beta1"; + +// Service Directory API for registering services. It defines the following +// resource model: +// +// - The API has a collection of +// [Namespace][google.cloud.servicedirectory.v1beta1.Namespace] +// resources, named `projects/*/locations/*/namespaces/*`. +// +// - Each Namespace has a collection of +// [Service][google.cloud.servicedirectory.v1beta1.Service] resources, named +// `projects/*/locations/*/namespaces/*/services/*`. +// +// - Each Service has a collection of +// [Endpoint][google.cloud.servicedirectory.v1beta1.Endpoint] +// resources, named +// `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. +service RegistrationService { + option (google.api.default_host) = "servicedirectory.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a namespace, and returns the new Namespace. + rpc CreateNamespace(CreateNamespaceRequest) returns (Namespace) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/namespaces" + body: "namespace" + }; + option (google.api.method_signature) = "parent,namespace,namespace_id"; + } + + // Lists all namespaces. + rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/namespaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a namespace. + rpc GetNamespace(GetNamespaceRequest) returns (Namespace) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/namespaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a namespace. + rpc UpdateNamespace(UpdateNamespaceRequest) returns (Namespace) { + option (google.api.http) = { + patch: "/v1beta1/{namespace.name=projects/*/locations/*/namespaces/*}" + body: "namespace" + }; + option (google.api.method_signature) = "namespace,update_mask"; + } + + // Deletes a namespace. This also deletes all services and endpoints in + // the namespace. + rpc DeleteNamespace(DeleteNamespaceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/namespaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a service, and returns the new Service. + rpc CreateService(CreateServiceRequest) returns (Service) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services" + body: "service" + }; + option (google.api.method_signature) = "parent,service,service_id"; + } + + // Lists all services belonging to a namespace. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/namespaces/*}/services" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a service. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a service. + rpc UpdateService(UpdateServiceRequest) returns (Service) { + option (google.api.http) = { + patch: "/v1beta1/{service.name=projects/*/locations/*/namespaces/*/services/*}" + body: "service" + }; + option (google.api.method_signature) = "service,update_mask"; + } + + // Deletes a service. This also deletes all endpoints associated with + // the service. + rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a endpoint, and returns the new Endpoint. + rpc CreateEndpoint(CreateEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints" + body: "endpoint" + }; + option (google.api.method_signature) = "parent,endpoint,endpoint_id"; + } + + // Lists all endpoints. + rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/namespaces/*/services/*}/endpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a endpoint. + rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a endpoint. + rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { + option (google.api.http) = { + patch: "/v1beta1/{endpoint.name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}" + body: "endpoint" + }; + option (google.api.method_signature) = "endpoint,update_mask"; + } + + // Deletes a endpoint. + rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/namespaces/*/services/*/endpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the IAM Policy for a resource (namespace or service only). + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:getIamPolicy" + body: "*" + } + }; + } + + // Sets the IAM Policy for a resource (namespace or service only). + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:setIamPolicy" + body: "*" + } + }; + } + + // Tests IAM permissions for a resource (namespace or service only). + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// The request message for [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateNamespace]. +message CreateNamespaceRequest { + // Required. The resource name of the project and location the namespace + // will be created in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The Resource ID must be 1-63 characters long, and comply with + // RFC1035. + // Specifically, the name must be 1-63 characters long and match the regular + // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + // character must be a lowercase letter, and all following characters must + // be a dash, lowercase letter, or digit, except the last character, which + // cannot be a dash. + string namespace_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A namespace with initial fields set. + Namespace namespace = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces]. +message ListNamespacesRequest { + // Required. The resource name of the project and location whose namespaces we'd like to + // list. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The maximum number of items to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to list result by. + // + // General filter string syntax: + // () + // can be "name", or "labels." for map field. + // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and + // is roughly the same as "=". + // must be the same data type as field. + // can be "AND, OR, NOT". + // + // Examples of valid filters: + // * "labels.owner" returns Namespaces that have a label with the key "owner" + // this is the same as "labels:owner". + // * "labels.protocol=gRPC" returns Namespaces that have key/value + // "protocol=gRPC". + // * "name>projects/my-project/locations/us-east/namespaces/namespace-c" + // returns Namespaces that have name that is alphabetically later than the + // string, so "namespace-e" will be returned but "namespace-a" will not be. + // * "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have + // "owner" in label key but value is not "sd" AND have key/value foo=bar. + // * "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't + // have a field called "doesnotexist". Since the filter does not match any + // Namespaces, it returns no results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The order to list result by. + // + // General order by string syntax: + // () (,) + // allows values {"name"} + // ascending or descending order by . If this is left + // blank, "asc" is used. + // Note that an empty order_by string result in default order, which is order + // by name in ascending order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1beta1.RegistrationService.ListNamespaces]. +message ListNamespacesResponse { + // The list of namespaces. + repeated Namespace namespaces = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.GetNamespace]. +message GetNamespaceRequest { + // Required. The name of the namespace to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Namespace" + } + ]; +} + +// The request message for [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateNamespace]. +message UpdateNamespaceRequest { + // Required. The updated namespace. + Namespace namespace = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteNamespace]. +message DeleteNamespaceRequest { + // Required. The name of the namespace to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Namespace" + } + ]; +} + +// The request message for [RegistrationService.CreateService][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateService]. +message CreateServiceRequest { + // Required. The resource name of the namespace this service will belong to. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Namespace" + } + ]; + + // Required. The Resource ID must be 1-63 characters long, and comply with + // RFC1035. + // Specifically, the name must be 1-63 characters long and match the regular + // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + // character must be a lowercase letter, and all following characters must + // be a dash, lowercase letter, or digit, except the last character, which + // cannot be a dash. + string service_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A service with initial fields set. + Service service = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. +message ListServicesRequest { + // Required. The resource name of the namespace whose services we'd + // like to list. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Namespace" + } + ]; + + // Optional. The maximum number of items to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to list result by. + // + // General filter string syntax: + // () + // can be "name", or "metadata." for map field. + // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and + // is roughly the same as "=". + // must be the same data type as field. + // can be "AND, OR, NOT". + // + // Examples of valid filters: + // * "metadata.owner" returns Services that have a label with the key "owner" + // this is the same as "metadata:owner". + // * "metadata.protocol=gRPC" returns Services that have key/value + // "protocol=gRPC". + // * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" + // returns Services that have name that is alphabetically later than the + // string, so "service-e" will be returned but "service-a" will not be. + // * "metadata.owner!=sd AND metadata.foo=bar" returns Services that have + // "owner" in label key but value is not "sd" AND have key/value foo=bar. + // * "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't + // have a field called "doesnotexist". Since the filter does not match any + // Services, it returns no results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The order to list result by. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. +message ListServicesResponse { + // The list of services. + repeated Service services = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. +// This should not be used for looking up a service. Insead, use the `resolve` +// method as it will contain all endpoints and associated metadata. +message GetServiceRequest { + // Required. The name of the service to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; +} + +// The request message for [RegistrationService.UpdateService][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateService]. +message UpdateServiceRequest { + // Required. The updated service. + Service service = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [RegistrationService.DeleteService][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteService]. +message DeleteServiceRequest { + // Required. The name of the service to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; +} + +// The request message for [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.CreateEndpoint]. +message CreateEndpointRequest { + // Required. The resource name of the service that this endpoint provides. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + + // Required. The Resource ID must be 1-63 characters long, and comply with + // RFC1035. + // Specifically, the name must be 1-63 characters long and match the regular + // expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first + // character must be a lowercase letter, and all following characters must + // be a dash, lowercase letter, or digit, except the last character, which + // cannot be a dash. + string endpoint_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A endpoint with initial fields set. + Endpoint endpoint = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. +message ListEndpointsRequest { + // Required. The resource name of the service whose endpoints we'd like to + // list. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Service" + } + ]; + + // Optional. The maximum number of items to return. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to list result by. + // + // General filter string syntax: + // () + // can be "name", "address", "port" or "metadata." for map field. + // can be "<, >, <=, >=, !=, =, :". Of which ":" means HAS, and + // is roughly the same as "=". + // must be the same data type as field. + // can be "AND, OR, NOT". + // + // Examples of valid filters: + // * "metadata.owner" returns Endpoints that have a label with the key "owner" + // this is the same as "metadata:owner". + // * "metadata.protocol=gRPC" returns Endpoints that have key/value + // "protocol=gRPC". + // * "address=192.108.1.105" returns Endpoints that have this address. + // * "port>8080" returns Endpoints that have port number larger than 8080. + // * "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" + // returns Endpoints that have name that is alphabetically later than the + // string, so "endpoint-e" will be returned but "endpoint-a" will not be. + // * "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have + // "owner" in label key but value is not "sd" AND have key/value foo=bar. + // * "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't + // have a field called "doesnotexist". Since the filter does not match any + // Endpoints, it returns no results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The order to list result by. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. +message ListEndpointsResponse { + // The list of endpoints. + repeated Endpoint endpoints = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.GetEndpoint]. +// This should not be used to lookup endpoints at runtime. Instead, use +// the `resolve` method. +message GetEndpointRequest { + // Required. The name of the endpoint to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Endpoint" + } + ]; +} + +// The request message for [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.UpdateEndpoint]. +message UpdateEndpointRequest { + // Required. The updated endpoint. + Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1beta1.RegistrationService.DeleteEndpoint]. +message DeleteEndpointRequest { + // Required. The name of the endpoint to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "servicedirectory.googleapis.com/Endpoint" + } + ]; +} diff --git a/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/service.proto b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/service.proto new file mode 100644 index 00000000..4acd8549 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/src/main/proto/google/cloud/servicedirectory/v1beta1/service.proto @@ -0,0 +1,53 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.servicedirectory.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/servicedirectory/v1beta1/endpoint.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1beta1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.servicedirectory.v1beta1"; + +// An individual service. A service contains a name and optional metadata. +// A service must exist before +// [endpoints][google.cloud.servicedirectory.v1beta1.Endpoint] can be +// added to it. +message Service { + option (google.api.resource) = { + type: "servicedirectory.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}" + }; + + // Immutable. The resource name for the service in the format + // 'projects/*/locations/*/namespaces/*/services/*'. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Metadata for the service. This data can be consumed by service + // clients. The entire metadata dictionary may contain up to 2000 characters, + // spread across all key-value pairs. Metadata that goes beyond any these + // limits will be rejected. + map metadata = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Endpoints associated with this service. Returned on LookupService.Resolve. + // Control plane clients should use RegistrationService.ListEndpoints. + repeated Endpoint endpoints = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..fc641270 --- /dev/null +++ b/renovate.json @@ -0,0 +1,78 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:libraries-bom" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true +} diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..e0738078 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,31 @@ +{ + "updateTime": "2020-03-06T18:13:41.570867Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "8f488efd7bda33885cb674ddd023b3678c40bd82", + "internalRef": "299370279" + } + }, + { + "template": { + "name": "java_library", + "origin": "synthtool.gcp", + "version": "2020.2.4" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "servicedirectory", + "apiVersion": "v1beta1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..8440d9bf --- /dev/null +++ b/synth.py @@ -0,0 +1,33 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +service = 'servicedirectory' +versions = ['v1beta1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + package_pattern='com.google.cloud.{service}.{version}', + proto_path=f'google/cloud/{service}/{version}', + bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', + ) + +java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..f56c85d1 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +proto-google-cloud-webrisk-v1beta1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-webrisk-v1beta1:0.0.0:0.0.1-SNAPSHOT +google-cloud-webrisk:0.0.0:0.0.1-SNAPSHOT