diff --git a/google-cloud-servicedirectory-bom/pom.xml b/google-cloud-servicedirectory-bom/pom.xml index efb4d016..71371415 100644 --- a/google-cloud-servicedirectory-bom/pom.xml +++ b/google-cloud-servicedirectory-bom/pom.xml @@ -71,11 +71,21 @@ grpc-google-cloud-servicedirectory-v1beta1 0.2.9-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1 + 0.2.9-SNAPSHOT + com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 0.2.9-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-servicedirectory-v1 + 0.2.9-SNAPSHOT + diff --git a/google-cloud-servicedirectory/pom.xml b/google-cloud-servicedirectory/pom.xml index 55fc6d3d..e0247706 100644 --- a/google-cloud-servicedirectory/pom.xml +++ b/google-cloud-servicedirectory/pom.xml @@ -50,6 +50,10 @@ com.google.api.grpc proto-google-cloud-servicedirectory-v1beta1 + + com.google.api.grpc + proto-google-cloud-servicedirectory-v1 + com.google.guava guava @@ -79,6 +83,11 @@ grpc-google-cloud-servicedirectory-v1beta1 test + + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1 + test + com.google.api diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceClient.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceClient.java new file mode 100644 index 00000000..c55a35df --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +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.v1.stub.LookupServiceStub; +import com.google.cloud.servicedirectory.v1.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.v1.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.v1.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/v1/LookupServiceSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceSettings.java new file mode 100644 index 00000000..c143a516 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +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.v1.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 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/v1/RegistrationServiceClient.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceClient.java new file mode 100644 index 00000000..9ea05177 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +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.v1.stub.RegistrationServiceStub; +import com.google.cloud.servicedirectory.v1.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.v1.Namespace] + * resources, named `projects/*/locations/*/namespaces/*`. + * + *

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

- Each Service has a collection of [Endpoint][google.cloud.servicedirectory.v1.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/v1/RegistrationServiceSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceSettings.java new file mode 100644 index 00000000..bbf7d811 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1.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.v1.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/v1/package-info.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/package-info.java new file mode 100644 index 00000000..f69eec32 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1.Namespace] + * resources, named `projects/*/locations/*/namespaces/*`. + * + *

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

- Each Service has a collection of [Endpoint][google.cloud.servicedirectory.v1.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.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcLookupServiceCallableFactory.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcLookupServiceCallableFactory.java new file mode 100644 index 00000000..ea35b341 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1.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/v1/stub/GrpcLookupServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcLookupServiceStub.java new file mode 100644 index 00000000..4d0ca1c0 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcLookupServiceStub.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF 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.v1.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.v1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1.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.v1.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/v1/stub/GrpcRegistrationServiceCallableFactory.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcRegistrationServiceCallableFactory.java new file mode 100644 index 00000000..59ad2073 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1.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/v1/stub/GrpcRegistrationServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcRegistrationServiceStub.java new file mode 100644 index 00000000..bb658be2 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcRegistrationServiceStub.java @@ -0,0 +1,734 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF 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.v1.stub; + +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest; +import com.google.cloud.servicedirectory.v1.CreateNamespaceRequest; +import com.google.cloud.servicedirectory.v1.CreateServiceRequest; +import com.google.cloud.servicedirectory.v1.DeleteEndpointRequest; +import com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest; +import com.google.cloud.servicedirectory.v1.DeleteServiceRequest; +import com.google.cloud.servicedirectory.v1.Endpoint; +import com.google.cloud.servicedirectory.v1.GetEndpointRequest; +import com.google.cloud.servicedirectory.v1.GetNamespaceRequest; +import com.google.cloud.servicedirectory.v1.GetServiceRequest; +import com.google.cloud.servicedirectory.v1.ListEndpointsRequest; +import com.google.cloud.servicedirectory.v1.ListEndpointsResponse; +import com.google.cloud.servicedirectory.v1.ListNamespacesRequest; +import com.google.cloud.servicedirectory.v1.ListNamespacesResponse; +import com.google.cloud.servicedirectory.v1.ListServicesRequest; +import com.google.cloud.servicedirectory.v1.ListServicesResponse; +import com.google.cloud.servicedirectory.v1.Namespace; +import com.google.cloud.servicedirectory.v1.Service; +import com.google.cloud.servicedirectory.v1.UpdateEndpointRequest; +import com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest; +import com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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/v1/stub/LookupServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/LookupServiceStub.java new file mode 100644 index 00000000..da23d839 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1.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.v1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1.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/v1/stub/LookupServiceStubSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/LookupServiceStubSettings.java new file mode 100644 index 00000000..35c484ae --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/LookupServiceStubSettings.java @@ -0,0 +1,292 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF 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.v1.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.v1.ResolveServiceRequest; +import com.google.cloud.servicedirectory.v1.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( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(15000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(15000L)) + .setTotalTimeout(Duration.ofMillis(15000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(15000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(15000L)) + .setTotalTimeout(Duration.ofMillis(15000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + 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("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + 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/v1/stub/RegistrationServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/RegistrationServiceStub.java new file mode 100644 index 00000000..c3857906 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/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.v1.stub; + +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest; +import com.google.cloud.servicedirectory.v1.CreateNamespaceRequest; +import com.google.cloud.servicedirectory.v1.CreateServiceRequest; +import com.google.cloud.servicedirectory.v1.DeleteEndpointRequest; +import com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest; +import com.google.cloud.servicedirectory.v1.DeleteServiceRequest; +import com.google.cloud.servicedirectory.v1.Endpoint; +import com.google.cloud.servicedirectory.v1.GetEndpointRequest; +import com.google.cloud.servicedirectory.v1.GetNamespaceRequest; +import com.google.cloud.servicedirectory.v1.GetServiceRequest; +import com.google.cloud.servicedirectory.v1.ListEndpointsRequest; +import com.google.cloud.servicedirectory.v1.ListEndpointsResponse; +import com.google.cloud.servicedirectory.v1.ListNamespacesRequest; +import com.google.cloud.servicedirectory.v1.ListNamespacesResponse; +import com.google.cloud.servicedirectory.v1.ListServicesRequest; +import com.google.cloud.servicedirectory.v1.ListServicesResponse; +import com.google.cloud.servicedirectory.v1.Namespace; +import com.google.cloud.servicedirectory.v1.Service; +import com.google.cloud.servicedirectory.v1.UpdateEndpointRequest; +import com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest; +import com.google.cloud.servicedirectory.v1.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/v1/stub/RegistrationServiceStubSettings.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/RegistrationServiceStubSettings.java new file mode 100644 index 00000000..ab3b1623 --- /dev/null +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/RegistrationServiceStubSettings.java @@ -0,0 +1,907 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF 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.v1.stub; + +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest; +import com.google.cloud.servicedirectory.v1.CreateNamespaceRequest; +import com.google.cloud.servicedirectory.v1.CreateServiceRequest; +import com.google.cloud.servicedirectory.v1.DeleteEndpointRequest; +import com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest; +import com.google.cloud.servicedirectory.v1.DeleteServiceRequest; +import com.google.cloud.servicedirectory.v1.Endpoint; +import com.google.cloud.servicedirectory.v1.GetEndpointRequest; +import com.google.cloud.servicedirectory.v1.GetNamespaceRequest; +import com.google.cloud.servicedirectory.v1.GetServiceRequest; +import com.google.cloud.servicedirectory.v1.ListEndpointsRequest; +import com.google.cloud.servicedirectory.v1.ListEndpointsResponse; +import com.google.cloud.servicedirectory.v1.ListNamespacesRequest; +import com.google.cloud.servicedirectory.v1.ListNamespacesResponse; +import com.google.cloud.servicedirectory.v1.ListServicesRequest; +import com.google.cloud.servicedirectory.v1.ListServicesResponse; +import com.google.cloud.servicedirectory.v1.Namespace; +import com.google.cloud.servicedirectory.v1.Service; +import com.google.cloud.servicedirectory.v1.UpdateEndpointRequest; +import com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest; +import com.google.cloud.servicedirectory.v1.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( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(15000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(15000L)) + .setTotalTimeout(Duration.ofMillis(15000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(15000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(15000L)) + .setTotalTimeout(Duration.ofMillis(15000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + 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("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listNamespacesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteNamespaceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listServicesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteServiceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .createEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listEndpointsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .updateEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .deleteEndpointSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + 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/v1/LookupServiceClientTest.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/LookupServiceClientTest.java new file mode 100644 index 00000000..af265618 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/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.v1; + +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/v1/MockLookupService.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockLookupService.java new file mode 100644 index 00000000..595cfd07 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@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/v1/MockLookupServiceImpl.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockLookupServiceImpl.java new file mode 100644 index 00000000..897ed625 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.servicedirectory.v1.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/v1/MockRegistrationService.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockRegistrationService.java new file mode 100644 index 00000000..811574c0 --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@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/v1/MockRegistrationServiceImpl.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockRegistrationServiceImpl.java new file mode 100644 index 00000000..ef737e7b --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.servicedirectory.v1.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/v1/RegistrationServiceClientTest.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/RegistrationServiceClientTest.java new file mode 100644 index 00000000..3e80e99b --- /dev/null +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/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.v1; + +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListEndpointsPagedResponse; +import static com.google.cloud.servicedirectory.v1.RegistrationServiceClient.ListNamespacesPagedResponse; +import static com.google.cloud.servicedirectory.v1.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-v1/pom.xml b/grpc-google-cloud-servicedirectory-v1/pom.xml new file mode 100644 index 00000000..c9067baf --- /dev/null +++ b/grpc-google-cloud-servicedirectory-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1 + 0.2.9-SNAPSHOT + grpc-google-cloud-servicedirectory-v1 + GRPC library for grpc-google-cloud-servicedirectory-v1 + + com.google.cloud + google-cloud-servicedirectory-parent + 0.2.9-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-v1 + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceGrpc.java b/grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceGrpc.java new file mode 100644 index 00000000..662e2c51 --- /dev/null +++ b/grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceGrpc.java @@ -0,0 +1,374 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF 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.v1; + +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/v1/lookup_service.proto") +public final class LookupServiceGrpc { + + private LookupServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.servicedirectory.v1.LookupService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1.ResolveServiceResponse> + getResolveServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResolveService", + requestType = com.google.cloud.servicedirectory.v1.ResolveServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.ResolveServiceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1.ResolveServiceResponse> + getResolveServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.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) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LookupServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LookupServiceStub(channel, callOptions); + } + }; + return LookupServiceStub.newStub(factory, 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) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LookupServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LookupServiceBlockingStub(channel, callOptions); + } + }; + return LookupServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LookupServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LookupServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LookupServiceFutureStub(channel, callOptions); + } + }; + return LookupServiceFutureStub.newStub(factory, 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.v1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public void resolveService( + com.google.cloud.servicedirectory.v1.ResolveServiceRequest request, + io.grpc.stub.StreamObserver + 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.v1.ResolveServiceRequest, + com.google.cloud.servicedirectory.v1.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.AbstractAsyncStub { + 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.v1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public void resolveService( + com.google.cloud.servicedirectory.v1.ResolveServiceRequest request, + io.grpc.stub.StreamObserver + 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.AbstractBlockingStub { + 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.v1.Service] and its
+     * associated endpoints.
+     * Resolving a service is not considered an active developer method.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.ResolveServiceResponse resolveService( + com.google.cloud.servicedirectory.v1.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.AbstractFutureStub { + 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.v1.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.v1.ResolveServiceResponse> + resolveService(com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1.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.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceGrpc.java b/grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceGrpc.java new file mode 100644 index 00000000..cacada8f --- /dev/null +++ b/grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceGrpc.java @@ -0,0 +1,2386 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF 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.v1; + +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.v1.Namespace]
+ * resources, named `projects/*/locations/*/namespaces/*`.
+ * - Each Namespace has a collection of
+ * [Service][google.cloud.servicedirectory.v1.Service] resources, named
+ * `projects/*/locations/*/namespaces/*/services/*`.
+ * - Each Service has a collection of
+ * [Endpoint][google.cloud.servicedirectory.v1.Endpoint]
+ * resources, named
+ * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/servicedirectory/v1/registration_service.proto") +public final class RegistrationServiceGrpc { + + private RegistrationServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.servicedirectory.v1.RegistrationService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace> + getCreateNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateNamespace", + requestType = com.google.cloud.servicedirectory.v1.CreateNamespaceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Namespace.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace> + getCreateNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("CreateNamespace")) + .build(); + } + } + } + return getCreateNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1.ListNamespacesResponse> + getListNamespacesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListNamespaces", + requestType = com.google.cloud.servicedirectory.v1.ListNamespacesRequest.class, + responseType = com.google.cloud.servicedirectory.v1.ListNamespacesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1.ListNamespacesResponse> + getListNamespacesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.ListNamespacesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("ListNamespaces")) + .build(); + } + } + } + return getListNamespacesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace> + getGetNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNamespace", + requestType = com.google.cloud.servicedirectory.v1.GetNamespaceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Namespace.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace> + getGetNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetNamespace")) + .build(); + } + } + } + return getGetNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace> + getUpdateNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateNamespace", + requestType = com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Namespace.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace> + getUpdateNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("UpdateNamespace")) + .build(); + } + } + } + return getUpdateNamespaceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest, com.google.protobuf.Empty> + getDeleteNamespaceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteNamespace", + requestType = com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest, com.google.protobuf.Empty> + getDeleteNamespaceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.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.v1.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.v1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1.Service> + getCreateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateService", + requestType = com.google.cloud.servicedirectory.v1.CreateServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Service.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1.Service> + getCreateServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Service.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("CreateService")) + .build(); + } + } + } + return getCreateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListServicesRequest, + com.google.cloud.servicedirectory.v1.ListServicesResponse> + getListServicesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListServices", + requestType = com.google.cloud.servicedirectory.v1.ListServicesRequest.class, + responseType = com.google.cloud.servicedirectory.v1.ListServicesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListServicesRequest, + com.google.cloud.servicedirectory.v1.ListServicesResponse> + getListServicesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListServicesRequest, + com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.ListServicesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("ListServices")) + .build(); + } + } + } + return getListServicesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetServiceRequest, + com.google.cloud.servicedirectory.v1.Service> + getGetServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetService", + requestType = com.google.cloud.servicedirectory.v1.GetServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Service.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetServiceRequest, + com.google.cloud.servicedirectory.v1.Service> + getGetServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetServiceRequest, + com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Service.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetService")) + .build(); + } + } + } + return getGetServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1.Service> + getUpdateServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateService", + requestType = com.google.cloud.servicedirectory.v1.UpdateServiceRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Service.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1.Service> + getUpdateServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Service.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("UpdateService")) + .build(); + } + } + } + return getUpdateServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteService", + requestType = com.google.cloud.servicedirectory.v1.DeleteServiceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.DeleteServiceRequest, com.google.protobuf.Empty> + getDeleteServiceMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.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.v1.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.v1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint> + getCreateEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateEndpoint", + requestType = com.google.cloud.servicedirectory.v1.CreateEndpointRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint> + getCreateEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("CreateEndpoint")) + .build(); + } + } + } + return getCreateEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1.ListEndpointsResponse> + getListEndpointsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEndpoints", + requestType = com.google.cloud.servicedirectory.v1.ListEndpointsRequest.class, + responseType = com.google.cloud.servicedirectory.v1.ListEndpointsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1.ListEndpointsResponse> + getListEndpointsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.ListEndpointsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("ListEndpoints")) + .build(); + } + } + } + return getListEndpointsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint> + getGetEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEndpoint", + requestType = com.google.cloud.servicedirectory.v1.GetEndpointRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint> + getGetEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("GetEndpoint")) + .build(); + } + } + } + return getGetEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint> + getUpdateEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateEndpoint", + requestType = com.google.cloud.servicedirectory.v1.UpdateEndpointRequest.class, + responseType = com.google.cloud.servicedirectory.v1.Endpoint.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint> + getUpdateEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance())) + .setSchemaDescriptor( + new RegistrationServiceMethodDescriptorSupplier("UpdateEndpoint")) + .build(); + } + } + } + return getUpdateEndpointMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest, com.google.protobuf.Empty> + getDeleteEndpointMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteEndpoint", + requestType = com.google.cloud.servicedirectory.v1.DeleteEndpointRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest, com.google.protobuf.Empty> + getDeleteEndpointMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.servicedirectory.v1.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.v1.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) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RegistrationServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegistrationServiceStub(channel, callOptions); + } + }; + return RegistrationServiceStub.newStub(factory, 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) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RegistrationServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegistrationServiceBlockingStub(channel, callOptions); + } + }; + return RegistrationServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RegistrationServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RegistrationServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegistrationServiceFutureStub(channel, callOptions); + } + }; + return RegistrationServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service Directory API for registering services. It defines the following
+   * resource model:
+   * - The API has a collection of
+   * [Namespace][google.cloud.servicedirectory.v1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateNamespaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public void listNamespaces( + com.google.cloud.servicedirectory.v1.ListNamespacesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListNamespacesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public void getNamespace( + com.google.cloud.servicedirectory.v1.GetNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetNamespaceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public void updateNamespace( + com.google.cloud.servicedirectory.v1.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.v1.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.v1.CreateServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateServiceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all services belonging to a namespace.
+     * 
+ */ + public void listServices( + com.google.cloud.servicedirectory.v1.ListServicesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListServicesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public void getService( + com.google.cloud.servicedirectory.v1.GetServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetServiceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public void updateService( + com.google.cloud.servicedirectory.v1.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.v1.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.v1.CreateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public void listEndpoints( + com.google.cloud.servicedirectory.v1.ListEndpointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListEndpointsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public void getEndpoint( + com.google.cloud.servicedirectory.v1.GetEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public void updateEndpoint( + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateEndpointMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public void deleteEndpoint( + com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace>( + this, METHODID_CREATE_NAMESPACE))) + .addMethod( + getListNamespacesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.ListNamespacesRequest, + com.google.cloud.servicedirectory.v1.ListNamespacesResponse>( + this, METHODID_LIST_NAMESPACES))) + .addMethod( + getGetNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.GetNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace>( + this, METHODID_GET_NAMESPACE))) + .addMethod( + getUpdateNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest, + com.google.cloud.servicedirectory.v1.Namespace>( + this, METHODID_UPDATE_NAMESPACE))) + .addMethod( + getDeleteNamespaceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_NAMESPACE))) + .addMethod( + getCreateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.CreateServiceRequest, + com.google.cloud.servicedirectory.v1.Service>(this, METHODID_CREATE_SERVICE))) + .addMethod( + getListServicesMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.ListServicesRequest, + com.google.cloud.servicedirectory.v1.ListServicesResponse>( + this, METHODID_LIST_SERVICES))) + .addMethod( + getGetServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.GetServiceRequest, + com.google.cloud.servicedirectory.v1.Service>(this, METHODID_GET_SERVICE))) + .addMethod( + getUpdateServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.UpdateServiceRequest, + com.google.cloud.servicedirectory.v1.Service>(this, METHODID_UPDATE_SERVICE))) + .addMethod( + getDeleteServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.DeleteServiceRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SERVICE))) + .addMethod( + getCreateEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.CreateEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint>( + this, METHODID_CREATE_ENDPOINT))) + .addMethod( + getListEndpointsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.ListEndpointsRequest, + com.google.cloud.servicedirectory.v1.ListEndpointsResponse>( + this, METHODID_LIST_ENDPOINTS))) + .addMethod( + getGetEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.GetEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint>(this, METHODID_GET_ENDPOINT))) + .addMethod( + getUpdateEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest, + com.google.cloud.servicedirectory.v1.Endpoint>( + this, METHODID_UPDATE_ENDPOINT))) + .addMethod( + getDeleteEndpointMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.servicedirectory.v1.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.v1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public static final class RegistrationServiceStub + extends io.grpc.stub.AbstractAsyncStub { + 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.v1.CreateNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateNamespaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public void listNamespaces( + com.google.cloud.servicedirectory.v1.ListNamespacesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListNamespacesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public void getNamespace( + com.google.cloud.servicedirectory.v1.GetNamespaceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetNamespaceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public void updateNamespace( + com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.ListServicesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListServicesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public void getService( + com.google.cloud.servicedirectory.v1.GetServiceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public void updateService( + com.google.cloud.servicedirectory.v1.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.v1.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.v1.CreateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public void listEndpoints( + com.google.cloud.servicedirectory.v1.ListEndpointsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListEndpointsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public void getEndpoint( + com.google.cloud.servicedirectory.v1.GetEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public void updateEndpoint( + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateEndpointMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public void deleteEndpoint( + com.google.cloud.servicedirectory.v1.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.v1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public static final class RegistrationServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + 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.v1.Namespace createNamespace( + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getCreateNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.ListNamespacesResponse listNamespaces( + com.google.cloud.servicedirectory.v1.ListNamespacesRequest request) { + return blockingUnaryCall(getChannel(), getListNamespacesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Namespace getNamespace( + com.google.cloud.servicedirectory.v1.GetNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getGetNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Namespace updateNamespace( + com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest request) { + return blockingUnaryCall(getChannel(), getDeleteNamespaceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a service, and returns the new Service.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Service createService( + com.google.cloud.servicedirectory.v1.CreateServiceRequest request) { + return blockingUnaryCall(getChannel(), getCreateServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all services belonging to a namespace.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.ListServicesResponse listServices( + com.google.cloud.servicedirectory.v1.ListServicesRequest request) { + return blockingUnaryCall(getChannel(), getListServicesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Service getService( + com.google.cloud.servicedirectory.v1.GetServiceRequest request) { + return blockingUnaryCall(getChannel(), getGetServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Service updateService( + com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest request) { + return blockingUnaryCall(getChannel(), getDeleteServiceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a endpoint, and returns the new Endpoint.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Endpoint createEndpoint( + com.google.cloud.servicedirectory.v1.CreateEndpointRequest request) { + return blockingUnaryCall(getChannel(), getCreateEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.ListEndpointsResponse listEndpoints( + com.google.cloud.servicedirectory.v1.ListEndpointsRequest request) { + return blockingUnaryCall(getChannel(), getListEndpointsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoint( + com.google.cloud.servicedirectory.v1.GetEndpointRequest request) { + return blockingUnaryCall(getChannel(), getGetEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public com.google.cloud.servicedirectory.v1.Endpoint updateEndpoint( + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest request) { + return blockingUnaryCall(getChannel(), getUpdateEndpointMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public com.google.protobuf.Empty deleteEndpoint( + com.google.cloud.servicedirectory.v1.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.v1.Namespace]
+   * resources, named `projects/*/locations/*/namespaces/*`.
+   * - Each Namespace has a collection of
+   * [Service][google.cloud.servicedirectory.v1.Service] resources, named
+   * `projects/*/locations/*/namespaces/*/services/*`.
+   * - Each Service has a collection of
+   * [Endpoint][google.cloud.servicedirectory.v1.Endpoint]
+   * resources, named
+   * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
+   * 
+ */ + public static final class RegistrationServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + 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.v1.Namespace> + createNamespace(com.google.cloud.servicedirectory.v1.CreateNamespaceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateNamespaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all namespaces.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.ListNamespacesResponse> + listNamespaces(com.google.cloud.servicedirectory.v1.ListNamespacesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListNamespacesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.Namespace> + getNamespace(com.google.cloud.servicedirectory.v1.GetNamespaceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetNamespaceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a namespace.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.Namespace> + updateNamespace(com.google.cloud.servicedirectory.v1.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.v1.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.v1.Service> + createService(com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse> + listServices(com.google.cloud.servicedirectory.v1.ListServicesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListServicesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.Service> + getService(com.google.cloud.servicedirectory.v1.GetServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetServiceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a service.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.Service> + updateService(com.google.cloud.servicedirectory.v1.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.v1.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.v1.Endpoint> + createEndpoint(com.google.cloud.servicedirectory.v1.CreateEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all endpoints.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.ListEndpointsResponse> + listEndpoints(com.google.cloud.servicedirectory.v1.ListEndpointsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListEndpointsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.Endpoint> + getEndpoint(com.google.cloud.servicedirectory.v1.GetEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.servicedirectory.v1.Endpoint> + updateEndpoint(com.google.cloud.servicedirectory.v1.UpdateEndpointRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateEndpointMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a endpoint.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteEndpoint(com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_NAMESPACES: + serviceImpl.listNamespaces( + (com.google.cloud.servicedirectory.v1.ListNamespacesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1.ListNamespacesResponse>) + responseObserver); + break; + case METHODID_GET_NAMESPACE: + serviceImpl.getNamespace( + (com.google.cloud.servicedirectory.v1.GetNamespaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_NAMESPACE: + serviceImpl.updateNamespace( + (com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_NAMESPACE: + serviceImpl.deleteNamespace( + (com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SERVICE: + serviceImpl.createService( + (com.google.cloud.servicedirectory.v1.CreateServiceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SERVICES: + serviceImpl.listServices( + (com.google.cloud.servicedirectory.v1.ListServicesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1.ListServicesResponse>) + responseObserver); + break; + case METHODID_GET_SERVICE: + serviceImpl.getService( + (com.google.cloud.servicedirectory.v1.GetServiceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SERVICE: + serviceImpl.updateService( + (com.google.cloud.servicedirectory.v1.UpdateServiceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SERVICE: + serviceImpl.deleteService( + (com.google.cloud.servicedirectory.v1.DeleteServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_ENDPOINT: + serviceImpl.createEndpoint( + (com.google.cloud.servicedirectory.v1.CreateEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_ENDPOINTS: + serviceImpl.listEndpoints( + (com.google.cloud.servicedirectory.v1.ListEndpointsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.servicedirectory.v1.ListEndpointsResponse>) + responseObserver); + break; + case METHODID_GET_ENDPOINT: + serviceImpl.getEndpoint( + (com.google.cloud.servicedirectory.v1.GetEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ENDPOINT: + serviceImpl.updateEndpoint( + (com.google.cloud.servicedirectory.v1.UpdateEndpointRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_ENDPOINT: + serviceImpl.deleteEndpoint( + (com.google.cloud.servicedirectory.v1.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.v1.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/pom.xml b/pom.xml index f6bcd676..aa886ef5 100644 --- a/pom.xml +++ b/pom.xml @@ -72,11 +72,21 @@ proto-google-cloud-servicedirectory-v1beta1 0.2.9-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-servicedirectory-v1 + 0.2.9-SNAPSHOT + com.google.api.grpc grpc-google-cloud-servicedirectory-v1beta1 0.2.9-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-servicedirectory-v1 + 0.2.9-SNAPSHOT + com.google.cloud google-cloud-servicedirectory @@ -119,7 +129,9 @@ proto-google-cloud-servicedirectory-v1beta1 + proto-google-cloud-servicedirectory-v1 grpc-google-cloud-servicedirectory-v1beta1 + grpc-google-cloud-servicedirectory-v1 google-cloud-servicedirectory google-cloud-servicedirectory-bom diff --git a/proto-google-cloud-servicedirectory-v1/clirr-ignored-differences.xml b/proto-google-cloud-servicedirectory-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..46accdd6 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/servicedirectory/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/servicedirectory/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/servicedirectory/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-servicedirectory-v1/pom.xml b/proto-google-cloud-servicedirectory-v1/pom.xml new file mode 100644 index 00000000..e7d7219e --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-servicedirectory-v1 + 0.2.9-SNAPSHOT + proto-google-cloud-servicedirectory-v1 + PROTO library for proto-google-cloud-servicedirectory-v1 + + com.google.cloud + google-cloud-servicedirectory-parent + 0.2.9-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 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequest.java new file mode 100644 index 00000000..183c5780 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequest.java @@ -0,0 +1,1176 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.CreateEndpoint][google.cloud.servicedirectory.v1.RegistrationService.CreateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.CreateEndpointRequest} + */ +public final class CreateEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Endpoint.Builder subBuilder = null; + if (endpoint_ != null) { + subBuilder = endpoint_.toBuilder(); + } + endpoint_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.CreateEndpointRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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.v1.Endpoint endpoint_; + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + @java.lang.Override + public boolean hasEndpoint() { + return endpoint_ != null; + } + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoint() { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance() + : endpoint_; + } + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.CreateEndpointRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.CreateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.CreateEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.CreateEndpointRequest) + com.google.cloud.servicedirectory.v1.CreateEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.CreateEndpointRequest.class, + com.google.cloud.servicedirectory.v1.CreateEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.CreateEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateEndpointRequest build() { + com.google.cloud.servicedirectory.v1.CreateEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1.CreateEndpointRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.CreateEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.CreateEndpointRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + endpointBuilder_; + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoint() { + if (endpointBuilder_ == null) { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance() + : endpoint_; + } else { + return endpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint( + com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEndpoint(com.google.cloud.servicedirectory.v1.Endpoint value) { + if (endpointBuilder_ == null) { + if (endpoint_ != null) { + endpoint_ = + com.google.cloud.servicedirectory.v1.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.v1.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.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder getEndpointBuilder() { + + onChanged(); + return getEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.EndpointOrBuilder getEndpointOrBuilder() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilder(); + } else { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance() + : endpoint_; + } + } + /** + * + * + *
+     * Required. A endpoint with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.CreateEndpointRequest) + private static final com.google.cloud.servicedirectory.v1.CreateEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.CreateEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequestOrBuilder.java new file mode 100644 index 00000000..e9bb4489 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface CreateEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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.v1.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.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + com.google.cloud.servicedirectory.v1.Endpoint getEndpoint(); + /** + * + * + *
+   * Required. A endpoint with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1.EndpointOrBuilder getEndpointOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequest.java new file mode 100644 index 00000000..ee59ae1f --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequest.java @@ -0,0 +1,1183 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1.RegistrationService.CreateNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.CreateNamespaceRequest} + */ +public final class CreateNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Namespace.Builder subBuilder = null; + if (namespace_ != null) { + subBuilder = namespace_.toBuilder(); + } + namespace_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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.v1.Namespace namespace_; + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + @java.lang.Override + public boolean hasNamespace() { + return namespace_ != null; + } + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Namespace getNamespace() { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance() + : namespace_; + } + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.CreateNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.CreateNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.CreateNamespaceRequest) + com.google.cloud.servicedirectory.v1.CreateNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateNamespaceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.CreateNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateNamespaceRequest build() { + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.CreateNamespaceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.CreateNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.CreateNamespaceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.Namespace namespace_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder> + namespaceBuilder_; + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + public com.google.cloud.servicedirectory.v1.Namespace getNamespace() { + if (namespaceBuilder_ == null) { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance() + : namespace_; + } else { + return namespaceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace(com.google.cloud.servicedirectory.v1.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.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace( + com.google.cloud.servicedirectory.v1.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.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNamespace(com.google.cloud.servicedirectory.v1.Namespace value) { + if (namespaceBuilder_ == null) { + if (namespace_ != null) { + namespace_ = + com.google.cloud.servicedirectory.v1.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.v1.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.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.Namespace.Builder getNamespaceBuilder() { + + onChanged(); + return getNamespaceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.NamespaceOrBuilder getNamespaceOrBuilder() { + if (namespaceBuilder_ != null) { + return namespaceBuilder_.getMessageOrBuilder(); + } else { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance() + : namespace_; + } + } + /** + * + * + *
+     * Required. A namespace with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder> + getNamespaceFieldBuilder() { + if (namespaceBuilder_ == null) { + namespaceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.CreateNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1.CreateNamespaceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.CreateNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateNamespaceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..a1391cc2 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface CreateNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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.v1.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.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + com.google.cloud.servicedirectory.v1.Namespace getNamespace(); + /** + * + * + *
+   * Required. A namespace with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder getNamespaceOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequest.java new file mode 100644 index 00000000..b52603c8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequest.java @@ -0,0 +1,1176 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.CreateService][google.cloud.servicedirectory.v1.RegistrationService.CreateService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.CreateServiceRequest} + */ +public final class CreateServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.CreateServiceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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.v1.Service service_; + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + @java.lang.Override + public boolean hasService() { + return service_ != null; + } + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service getService() { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.CreateServiceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.CreateService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.CreateServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.CreateServiceRequest) + com.google.cloud.servicedirectory.v1.CreateServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.CreateServiceRequest.class, + com.google.cloud.servicedirectory.v1.CreateServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateServiceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.CreateServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateServiceRequest build() { + com.google.cloud.servicedirectory.v1.CreateServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.CreateServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.CreateServiceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.CreateServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.CreateServiceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + serviceBuilder_; + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService(com.google.cloud.servicedirectory.v1.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.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService( + com.google.cloud.servicedirectory.v1.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.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeService(com.google.cloud.servicedirectory.v1.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.cloud.servicedirectory.v1.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.v1.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.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } + } + /** + * + * + *
+     * Required. A service  with initial fields set.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.CreateServiceRequest) + private static final com.google.cloud.servicedirectory.v1.CreateServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.CreateServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.CreateServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequestOrBuilder.java new file mode 100644 index 00000000..3f8bd21a --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface CreateServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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.v1.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.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + com.google.cloud.servicedirectory.v1.Service getService(); + /** + * + * + *
+   * Required. A service  with initial fields set.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1.ServiceOrBuilder getServiceOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequest.java new file mode 100644 index 00000000..556cd731 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequest.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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.DeleteEndpoint][google.cloud.servicedirectory.v1.RegistrationService.DeleteEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.DeleteEndpointRequest} + */ +public final class DeleteEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the endpoint to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.DeleteEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.DeleteEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.DeleteEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.DeleteEndpointRequest) + com.google.cloud.servicedirectory.v1.DeleteEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest.class, + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.DeleteEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteEndpointRequest build() { + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1.DeleteEndpointRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.DeleteEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.DeleteEndpointRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.DeleteEndpointRequest) + private static final com.google.cloud.servicedirectory.v1.DeleteEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.DeleteEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequestOrBuilder.java new file mode 100644 index 00000000..ce4ae2c5 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface DeleteEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequest.java new file mode 100644 index 00000000..7035610a --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequest.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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.DeleteNamespace][google.cloud.servicedirectory.v1.RegistrationService.DeleteNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.DeleteNamespaceRequest} + */ +public final class DeleteNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the namespace to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.DeleteNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.DeleteNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.DeleteNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.DeleteNamespaceRequest) + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest build() { + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.DeleteNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.DeleteNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteNamespaceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..124dd105 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface DeleteNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequest.java new file mode 100644 index 00000000..716eb733 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequest.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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.DeleteService][google.cloud.servicedirectory.v1.RegistrationService.DeleteService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.DeleteServiceRequest} + */ +public final class DeleteServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.DeleteServiceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to delete.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.DeleteServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.DeleteServiceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.DeleteService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.DeleteServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.DeleteServiceRequest) + com.google.cloud.servicedirectory.v1.DeleteServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.DeleteServiceRequest.class, + com.google.cloud.servicedirectory.v1.DeleteServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteServiceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.DeleteServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteServiceRequest build() { + com.google.cloud.servicedirectory.v1.DeleteServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.DeleteServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.DeleteServiceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.DeleteServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.DeleteServiceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.DeleteServiceRequest) + private static final com.google.cloud.servicedirectory.v1.DeleteServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.DeleteServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.DeleteServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequestOrBuilder.java new file mode 100644 index 00000000..373cb977 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface DeleteServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/Endpoint.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Endpoint.java new file mode 100644 index 00000000..37444aba --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Endpoint.java @@ -0,0 +1,1514 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/endpoint.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * An individual endpoint that provides a
+ * [service][google.cloud.servicedirectory.v1.Service]. The service must
+ * already exist to create an endpoint.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.Endpoint} + */ +public final class Endpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + annotations_ = + com.google.protobuf.MapField.newMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + annotations_.getMutableMap().put(annotations__.getKey(), annotations__.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.v1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1_Endpoint_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.Endpoint.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.servicedirectory.v1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1_Endpoint_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().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, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + 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 : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + 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.v1.Endpoint)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.Endpoint other = + (com.google.cloud.servicedirectory.v1.Endpoint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAddress().equals(other.getAddress())) return false; + if (getPort() != other.getPort()) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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 (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.servicedirectory.v1.Endpoint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Endpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Endpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Endpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Endpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Service]. The service must
+   * already exist to create an endpoint.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.Endpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.Endpoint) + com.google.cloud.servicedirectory.v1.EndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1_Endpoint_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1_Endpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.Endpoint.class, + com.google.cloud.servicedirectory.v1.Endpoint.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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; + + internalGetMutableAnnotations().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.servicedirectory.v1.EndpointProto + .internal_static_google_cloud_servicedirectory_v1_Endpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Endpoint getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Endpoint build() { + com.google.cloud.servicedirectory.v1.Endpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Endpoint buildPartial() { + com.google.cloud.servicedirectory.v1.Endpoint result = + new com.google.cloud.servicedirectory.v1.Endpoint(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.address_ = address_; + result.port_ = port_; + result.annotations_ = internalGetAnnotations(); + result.annotations_.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.v1.Endpoint) { + return mergeFrom((com.google.cloud.servicedirectory.v1.Endpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.Endpoint other) { + if (other == com.google.cloud.servicedirectory.v1.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()); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + 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.v1.Endpoint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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 annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + onChanged(); + ; + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Annotations for the endpoint. This data can be consumed by
+     * service clients. Restrictions:
+     *  - The entire annotations dictionary may contain up to 512 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().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.v1.Endpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.Endpoint) + private static final com.google.cloud.servicedirectory.v1.Endpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.Endpoint(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Endpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointName.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointName.java new file mode 100644 index 00000000..70f879b6 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** 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-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointOrBuilder.java new file mode 100644 index 00000000..5a09709e --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointOrBuilder.java @@ -0,0 +1,258 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/endpoint.proto + +package com.google.cloud.servicedirectory.v1; + +public interface EndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Annotations for the endpoint. This data can be consumed by
+   * service clients. Restrictions:
+   *  - The entire annotations dictionary may contain up to 512 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointProto.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointProto.java new file mode 100644 index 00000000..68410e1e --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointProto.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/endpoint.proto + +package com.google.cloud.servicedirectory.v1; + +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_v1_Endpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_Endpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_Endpoint_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_Endpoint_AnnotationsEntry_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/v1/endpo" + + "int.proto\022 google.cloud.servicedirectory" + + ".v1\032\034google/api/annotations.proto\032\037googl" + + "e/api/field_behavior.proto\032\031google/api/r" + + "esource.proto\"\352\002\n\010Endpoint\022\021\n\004name\030\001 \001(\t" + + "B\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\022U\n\013annotations\030\005 \003(\0132;.google.clo" + + "ud.servicedirectory.v1.Endpoint.Annotati" + + "onsEntryB\003\340A\001\0322\n\020AnnotationsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\226\001\352A\222\001\n(servic" + + "edirectory.googleapis.com/Endpoint\022fproj" + + "ects/{project}/locations/{location}/name" + + "spaces/{namespace}/services/{service}/en" + + "dpoints/{endpoint}B\370\001\n$com.google.cloud." + + "servicedirectory.v1B\rEndpointProtoP\001ZPgo" + + "ogle.golang.org/genproto/googleapis/clou" + + "d/servicedirectory/v1;servicedirectory\370\001" + + "\001\252\002 Google.Cloud.ServiceDirectory.V1\312\002 G" + + "oogle\\Cloud\\ServiceDirectory\\V1\352\002#Google" + + "::Cloud::ServiceDirectory::V1b\006proto3" + }; + 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(), + }); + internal_static_google_cloud_servicedirectory_v1_Endpoint_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1_Endpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_Endpoint_descriptor, + new java.lang.String[] { + "Name", "Address", "Port", "Annotations", + }); + internal_static_google_cloud_servicedirectory_v1_Endpoint_AnnotationsEntry_descriptor = + internal_static_google_cloud_servicedirectory_v1_Endpoint_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_servicedirectory_v1_Endpoint_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_Endpoint_AnnotationsEntry_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.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequest.java new file mode 100644 index 00000000..38432a71 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.GetEndpoint][google.cloud.servicedirectory.v1.RegistrationService.GetEndpoint].
+ * This should not be used to lookup endpoints at runtime. Instead, use
+ * the `resolve` method.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.GetEndpointRequest} + */ +public final class GetEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.GetEndpointRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the endpoint to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.GetEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.GetEndpointRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.GetEndpoint].
+   * This should not be used to lookup endpoints at runtime. Instead, use
+   * the `resolve` method.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.GetEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.GetEndpointRequest) + com.google.cloud.servicedirectory.v1.GetEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.GetEndpointRequest.class, + com.google.cloud.servicedirectory.v1.GetEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.GetEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetEndpointRequest build() { + com.google.cloud.servicedirectory.v1.GetEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1.GetEndpointRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.GetEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.GetEndpointRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.GetEndpointRequest) + private static final com.google.cloud.servicedirectory.v1.GetEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.GetEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequestOrBuilder.java new file mode 100644 index 00000000..9d52021d --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface GetEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetNamespaceRequest.java new file mode 100644 index 00000000..084f6092 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.GetNamespace][google.cloud.servicedirectory.v1.RegistrationService.GetNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.GetNamespaceRequest} + */ +public final class GetNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.GetNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the namespace to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.GetNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.GetNamespaceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.GetNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.GetNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.GetNamespaceRequest) + com.google.cloud.servicedirectory.v1.GetNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.GetNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.GetNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetNamespaceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.GetNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetNamespaceRequest build() { + com.google.cloud.servicedirectory.v1.GetNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.GetNamespaceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.GetNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.GetNamespaceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.GetNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1.GetNamespaceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.GetNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetNamespaceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..e0671bf3 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface GetNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequest.java new file mode 100644 index 00000000..b58a4cb1 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequest.java @@ -0,0 +1,657 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.GetService][google.cloud.servicedirectory.v1.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.v1.GetServiceRequest} + */ +public final class GetServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.GetServiceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.GetServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.GetServiceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.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.v1.GetServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.GetServiceRequest) + com.google.cloud.servicedirectory.v1.GetServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.GetServiceRequest.class, + com.google.cloud.servicedirectory.v1.GetServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetServiceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.GetServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetServiceRequest build() { + com.google.cloud.servicedirectory.v1.GetServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.GetServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.GetServiceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.GetServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.GetServiceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.GetServiceRequest) + private static final com.google.cloud.servicedirectory.v1.GetServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.GetServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.GetServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequestOrBuilder.java new file mode 100644 index 00000000..03050250 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface GetServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequest.java new file mode 100644 index 00000000..6a435809 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequest.java @@ -0,0 +1,1448 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListEndpointsRequest} + */ +public final class ListEndpointsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListEndpointsRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * 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.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + 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. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + 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. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.ListEndpointsRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ListEndpointsRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.ListEndpoints].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListEndpointsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ListEndpointsRequest) + com.google.cloud.servicedirectory.v1.ListEndpointsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListEndpointsRequest.class, + com.google.cloud.servicedirectory.v1.ListEndpointsRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListEndpointsRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ListEndpointsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListEndpointsRequest build() { + com.google.cloud.servicedirectory.v1.ListEndpointsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListEndpointsRequest buildPartial() { + com.google.cloud.servicedirectory.v1.ListEndpointsRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ListEndpointsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ListEndpointsRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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.v1.ListEndpointsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ListEndpointsRequest) + private static final com.google.cloud.servicedirectory.v1.ListEndpointsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ListEndpointsRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequestOrBuilder.java new file mode 100644 index 00000000..1a433595 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ListEndpointsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponse.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponse.java new file mode 100644 index 00000000..0b534f1c --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponse.java @@ -0,0 +1,1141 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The response message for
+ * [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1.RegistrationService.ListEndpoints].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListEndpointsResponse} + */ +public final class ListEndpointsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListEndpointsResponse.class, + com.google.cloud.servicedirectory.v1.ListEndpointsResponse.Builder.class); + } + + public static final int ENDPOINTS_FIELD_NUMBER = 1; + private java.util.List endpoints_; + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + @java.lang.Override + public java.util.List getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + @java.lang.Override + public java.util.List + getEndpointsOrBuilderList() { + return endpoints_; + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + @java.lang.Override + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.v1.ListEndpointsResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ListEndpointsResponse other = + (com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.ListEndpoints].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListEndpointsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ListEndpointsResponse) + com.google.cloud.servicedirectory.v1.ListEndpointsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListEndpointsResponse.class, + com.google.cloud.servicedirectory.v1.ListEndpointsResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListEndpointsResponse getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ListEndpointsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListEndpointsResponse build() { + com.google.cloud.servicedirectory.v1.ListEndpointsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListEndpointsResponse buildPartial() { + com.google.cloud.servicedirectory.v1.ListEndpointsResponse result = + new com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ListEndpointsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ListEndpointsResponse other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public int getEndpointsCount() { + if (endpointsBuilder_ == null) { + return endpoints_.size(); + } else { + return endpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoints(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + public Builder setEndpoints(int index, com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public Builder setEndpoints( + int index, com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public Builder addEndpoints(com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public Builder addEndpoints(int index, com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public Builder addEndpoints( + com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public Builder addEndpoints( + int index, com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder getEndpointsBuilder(int index) { + return getEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1.EndpointOrBuilder getEndpointsOrBuilder(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder addEndpointsBuilder(int index) { + return getEndpointsFieldBuilder() + .addBuilder(index, com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * The list of endpoints.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + public java.util.List + getEndpointsBuilderList() { + return getEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ListEndpointsResponse) + private static final com.google.cloud.servicedirectory.v1.ListEndpointsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ListEndpointsResponse(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListEndpointsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponseOrBuilder.java new file mode 100644 index 00000000..72f8af75 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ListEndpointsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.ListEndpointsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + com.google.cloud.servicedirectory.v1.Endpoint getEndpoints(int index); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + int getEndpointsCount(); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + java.util.List + getEndpointsOrBuilderList(); + /** + * + * + *
+   * The list of endpoints.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 1; + */ + com.google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequest.java new file mode 100644 index 00000000..97cb63e7 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequest.java @@ -0,0 +1,1483 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1.RegistrationService.ListNamespaces].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListNamespacesRequest} + */ +public final class ListNamespacesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListNamespacesRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * 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.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + 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. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + 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. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.ListNamespacesRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ListNamespacesRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.ListNamespaces].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListNamespacesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ListNamespacesRequest) + com.google.cloud.servicedirectory.v1.ListNamespacesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListNamespacesRequest.class, + com.google.cloud.servicedirectory.v1.ListNamespacesRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListNamespacesRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ListNamespacesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListNamespacesRequest build() { + com.google.cloud.servicedirectory.v1.ListNamespacesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListNamespacesRequest buildPartial() { + com.google.cloud.servicedirectory.v1.ListNamespacesRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ListNamespacesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ListNamespacesRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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.v1.ListNamespacesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ListNamespacesRequest) + private static final com.google.cloud.servicedirectory.v1.ListNamespacesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ListNamespacesRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequestOrBuilder.java new file mode 100644 index 00000000..54b01c3f --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequestOrBuilder.java @@ -0,0 +1,200 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ListNamespacesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponse.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponse.java new file mode 100644 index 00000000..4e2d6e7a --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponse.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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The response message for
+ * [RegistrationService.ListNamespaces][google.cloud.servicedirectory.v1.RegistrationService.ListNamespaces].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListNamespacesResponse} + */ +public final class ListNamespacesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListNamespacesResponse.class, + com.google.cloud.servicedirectory.v1.ListNamespacesResponse.Builder.class); + } + + public static final int NAMESPACES_FIELD_NUMBER = 1; + private java.util.List namespaces_; + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + @java.lang.Override + public java.util.List getNamespacesList() { + return namespaces_; + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + @java.lang.Override + public java.util.List + getNamespacesOrBuilderList() { + return namespaces_; + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + @java.lang.Override + public int getNamespacesCount() { + return namespaces_.size(); + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Namespace getNamespaces(int index) { + return namespaces_.get(index); + } + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.v1.ListNamespacesResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ListNamespacesResponse other = + (com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.ListNamespaces].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListNamespacesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ListNamespacesResponse) + com.google.cloud.servicedirectory.v1.ListNamespacesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListNamespacesResponse.class, + com.google.cloud.servicedirectory.v1.ListNamespacesResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListNamespacesResponse getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ListNamespacesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListNamespacesResponse build() { + com.google.cloud.servicedirectory.v1.ListNamespacesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListNamespacesResponse buildPartial() { + com.google.cloud.servicedirectory.v1.ListNamespacesResponse result = + new com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ListNamespacesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ListNamespacesResponse other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder> + namespacesBuilder_; + + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public int getNamespacesCount() { + if (namespacesBuilder_ == null) { + return namespaces_.size(); + } else { + return namespacesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1.Namespace getNamespaces(int index) { + if (namespacesBuilder_ == null) { + return namespaces_.get(index); + } else { + return namespacesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + public Builder setNamespaces(int index, com.google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public Builder setNamespaces( + int index, com.google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public Builder addNamespaces(com.google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public Builder addNamespaces(int index, com.google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public Builder addNamespaces( + com.google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public Builder addNamespaces( + int index, com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1.Namespace.Builder getNamespacesBuilder(int index) { + return getNamespacesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1.NamespaceOrBuilder getNamespacesOrBuilder( + int index) { + if (namespacesBuilder_ == null) { + return namespaces_.get(index); + } else { + return namespacesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.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.v1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1.Namespace.Builder addNamespacesBuilder() { + return getNamespacesFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance()); + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + public com.google.cloud.servicedirectory.v1.Namespace.Builder addNamespacesBuilder(int index) { + return getNamespacesFieldBuilder() + .addBuilder(index, com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance()); + } + /** + * + * + *
+     * The list of namespaces.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + public java.util.List + getNamespacesBuilderList() { + return getNamespacesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder> + getNamespacesFieldBuilder() { + if (namespacesBuilder_ == null) { + namespacesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ListNamespacesResponse) + private static final com.google.cloud.servicedirectory.v1.ListNamespacesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ListNamespacesResponse(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListNamespacesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponseOrBuilder.java new file mode 100644 index 00000000..bdd6e9f9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ListNamespacesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.ListNamespacesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + java.util.List getNamespacesList(); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + com.google.cloud.servicedirectory.v1.Namespace getNamespaces(int index); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + int getNamespacesCount(); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + java.util.List + getNamespacesOrBuilderList(); + /** + * + * + *
+   * The list of namespaces.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Namespace namespaces = 1; + */ + com.google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequest.java new file mode 100644 index 00000000..ab7e61d3 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequest.java @@ -0,0 +1,1434 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.ListServices][google.cloud.servicedirectory.v1.RegistrationService.ListServices].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListServicesRequest} + */ +public final class ListServicesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListServicesRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of items to return.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * 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.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + 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. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + 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. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The order to list result by.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!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.v1.ListServicesRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ListServicesRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.ListServices].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListServicesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ListServicesRequest) + com.google.cloud.servicedirectory.v1.ListServicesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListServicesRequest.class, + com.google.cloud.servicedirectory.v1.ListServicesRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListServicesRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ListServicesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListServicesRequest build() { + com.google.cloud.servicedirectory.v1.ListServicesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListServicesRequest buildPartial() { + com.google.cloud.servicedirectory.v1.ListServicesRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ListServicesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ListServicesRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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.v1.ListServicesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ListServicesRequest) + private static final com.google.cloud.servicedirectory.v1.ListServicesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ListServicesRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequestOrBuilder.java new file mode 100644 index 00000000..9a230200 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ListServicesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponse.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponse.java new file mode 100644 index 00000000..a1ad9a30 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponse.java @@ -0,0 +1,1140 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The response message for
+ * [RegistrationService.ListServices][google.cloud.servicedirectory.v1.RegistrationService.ListServices].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListServicesResponse} + */ +public final class ListServicesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListServicesResponse.class, + com.google.cloud.servicedirectory.v1.ListServicesResponse.Builder.class); + } + + public static final int SERVICES_FIELD_NUMBER = 1; + private java.util.List services_; + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + @java.lang.Override + public java.util.List getServicesList() { + return services_; + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + @java.lang.Override + public java.util.List + getServicesOrBuilderList() { + return services_; + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + @java.lang.Override + public int getServicesCount() { + return services_.size(); + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service getServices(int index) { + return services_.get(index); + } + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.v1.ListServicesResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ListServicesResponse other = + (com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.ListServices].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ListServicesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ListServicesResponse) + com.google.cloud.servicedirectory.v1.ListServicesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ListServicesResponse.class, + com.google.cloud.servicedirectory.v1.ListServicesResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListServicesResponse getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ListServicesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListServicesResponse build() { + com.google.cloud.servicedirectory.v1.ListServicesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ListServicesResponse buildPartial() { + com.google.cloud.servicedirectory.v1.ListServicesResponse result = + new com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ListServicesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ListServicesResponse other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + servicesBuilder_; + + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public int getServicesCount() { + if (servicesBuilder_ == null) { + return services_.size(); + } else { + return servicesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1.Service getServices(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); + } else { + return servicesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + public Builder setServices(int index, com.google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public Builder setServices( + int index, com.google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public Builder addServices(com.google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public Builder addServices(int index, com.google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public Builder addServices( + com.google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public Builder addServices( + int index, com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1.Service.Builder getServicesBuilder(int index) { + return getServicesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1.ServiceOrBuilder getServicesOrBuilder(int index) { + if (servicesBuilder_ == null) { + return services_.get(index); + } else { + return servicesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.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.v1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1.Service.Builder addServicesBuilder() { + return getServicesFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1.Service.getDefaultInstance()); + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + public com.google.cloud.servicedirectory.v1.Service.Builder addServicesBuilder(int index) { + return getServicesFieldBuilder() + .addBuilder(index, com.google.cloud.servicedirectory.v1.Service.getDefaultInstance()); + } + /** + * + * + *
+     * The list of services.
+     * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + public java.util.List + getServicesBuilderList() { + return getServicesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + getServicesFieldBuilder() { + if (servicesBuilder_ == null) { + servicesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ListServicesResponse) + private static final com.google.cloud.servicedirectory.v1.ListServicesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ListServicesResponse(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ListServicesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponseOrBuilder.java new file mode 100644 index 00000000..5e6e0403 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ListServicesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.ListServicesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + java.util.List getServicesList(); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + com.google.cloud.servicedirectory.v1.Service getServices(int index); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + int getServicesCount(); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + java.util.List + getServicesOrBuilderList(); + /** + * + * + *
+   * The list of services.
+   * 
+ * + * repeated .google.cloud.servicedirectory.v1.Service services = 1; + */ + com.google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/LocationName.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LocationName.java new file mode 100644 index 00000000..1936ce20 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** 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-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceProto.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceProto.java new file mode 100644 index 00000000..e02120d4 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceProto.java @@ -0,0 +1,118 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1; + +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_v1_ResolveServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_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 = { + "\n5google/cloud/servicedirectory/v1/looku" + + "p_service.proto\022 google.cloud.servicedir" + + "ectory.v1\032\034google/api/annotations.proto\032" + + "\027google/api/client.proto\032\037google/api/fie" + + "ld_behavior.proto\032\031google/api/resource.p" + + "roto\032.google/cloud/servicedirectory/v1/s" + + "ervice.proto\"\220\001\n\025ResolveServiceRequest\022=" + + "\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'servicedirectory.g" + + "oogleapis.com/Service\022\032\n\rmax_endpoints\030\002" + + " \001(\005B\003\340A\001\022\034\n\017endpoint_filter\030\003 \001(\tB\003\340A\001\"" + + "T\n\026ResolveServiceResponse\022:\n\007service\030\001 \001" + + "(\0132).google.cloud.servicedirectory.v1.Se" + + "rvice2\270\002\n\rLookupService\022\321\001\n\016ResolveServi" + + "ce\0227.google.cloud.servicedirectory.v1.Re" + + "solveServiceRequest\0328.google.cloud.servi" + + "cedirectory.v1.ResolveServiceResponse\"L\202" + + "\323\344\223\002F\"A/v1/{name=projects/*/locations/*/" + + "namespaces/*/services/*}:resolve:\001*\032S\312A\037" + + "servicedirectory.googleapis.com\322A.https:" + + "//www.googleapis.com/auth/cloud-platform" + + "B\375\001\n$com.google.cloud.servicedirectory.v" + + "1B\022LookupServiceProtoP\001ZPgoogle.golang.o" + + "rg/genproto/googleapis/cloud/servicedire" + + "ctory/v1;servicedirectory\370\001\001\252\002 Google.Cl" + + "oud.ServiceDirectory.V1\312\002 Google\\Cloud\\S" + + "erviceDirectory\\V1\352\002#Google::Cloud::Serv" + + "iceDirectory::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.servicedirectory.v1.ServiceProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_descriptor, + new java.lang.String[] { + "Name", "MaxEndpoints", "EndpointFilter", + }); + internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_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.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.servicedirectory.v1.ServiceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Namespace.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Namespace.java new file mode 100644 index 00000000..54a2bd82 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Namespace.java @@ -0,0 +1,991 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/namespace.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * A container for [services][google.cloud.servicedirectory.v1.Service].
+ * Namespaces allow administrators to group services together and define
+ * permissions for a collection of services.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.Namespace} + */ +public final class Namespace extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1_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.v1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1_Namespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.Namespace.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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.v1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1_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]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * 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.Override + 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]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * 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.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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.v1.Namespace)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.Namespace other = + (com.google.cloud.servicedirectory.v1.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.v1.Namespace parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Namespace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Namespace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Namespace parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Namespace parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Service].
+   * Namespaces allow administrators to group services together and define
+   * permissions for a collection of services.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.Namespace} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.Namespace) + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1_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.v1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1_Namespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.Namespace.class, + com.google.cloud.servicedirectory.v1.Namespace.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.NamespaceProto + .internal_static_google_cloud_servicedirectory_v1_Namespace_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Namespace getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Namespace build() { + com.google.cloud.servicedirectory.v1.Namespace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Namespace buildPartial() { + com.google.cloud.servicedirectory.v1.Namespace result = + new com.google.cloud.servicedirectory.v1.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.v1.Namespace) { + return mergeFrom((com.google.cloud.servicedirectory.v1.Namespace) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.Namespace other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.Namespace parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.servicedirectory.v1.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]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * 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.Override + 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]; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * 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.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * 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.v1.Namespace) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.Namespace) + private static final com.google.cloud.servicedirectory.v1.Namespace DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.Namespace(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Namespace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceName.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceName.java new file mode 100644 index 00000000..39126824 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** 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-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceOrBuilder.java new file mode 100644 index 00000000..72349710 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/namespace.proto + +package com.google.cloud.servicedirectory.v1; + +public interface NamespaceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceProto.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceProto.java new file mode 100644 index 00000000..06c721a1 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceProto.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/v1/namespace.proto + +package com.google.cloud.servicedirectory.v1; + +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_v1_Namespace_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_Namespace_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_Namespace_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_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 = { + "\n0google/cloud/servicedirectory/v1/names" + + "pace.proto\022 google.cloud.servicedirector" + + "y.v1\032\034google/api/annotations.proto\032\037goog" + + "le/api/field_behavior.proto\032\031google/api/" + + "resource.proto\"\213\002\n\tNamespace\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\005\022L\n\006labels\030\002 \003(\01327.google.cloud.s" + + "ervicedirectory.v1.Namespace.LabelsEntry" + + "B\003\340A\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val" + + "ue\030\002 \001(\t:\0028\001:n\352Ak\n)servicedirectory.goog" + + "leapis.com/Namespace\022>projects/{project}" + + "/locations/{location}/namespaces/{namesp" + + "ace}B\371\001\n$com.google.cloud.servicedirecto" + + "ry.v1B\016NamespaceProtoP\001ZPgoogle.golang.o" + + "rg/genproto/googleapis/cloud/servicedire" + + "ctory/v1;servicedirectory\370\001\001\252\002 Google.Cl" + + "oud.ServiceDirectory.V1\312\002 Google\\Cloud\\S" + + "erviceDirectory\\V1\352\002#Google::Cloud::Serv" + + "iceDirectory::V1b\006proto3" + }; + 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(), + }); + internal_static_google_cloud_servicedirectory_v1_Namespace_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1_Namespace_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_Namespace_descriptor, + new java.lang.String[] { + "Name", "Labels", + }); + internal_static_google_cloud_servicedirectory_v1_Namespace_LabelsEntry_descriptor = + internal_static_google_cloud_servicedirectory_v1_Namespace_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_servicedirectory_v1_Namespace_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_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.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceProto.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceProto.java new file mode 100644 index 00000000..70496503 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceProto.java @@ -0,0 +1,474 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +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_v1_CreateNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_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/v1/regis" + + "tration_service.proto\022 google.cloud.serv" + + "icedirectory.v1\032\034google/api/annotations." + + "proto\032\027google/api/client.proto\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\032/google/cloud/servicedirector" + + "y/v1/endpoint.proto\0320google/cloud/servic" + + "edirectory/v1/namespace.proto\032.google/cl" + + "oud/servicedirectory/v1/service.proto\032\036g" + + "oogle/iam/v1/iam_policy.proto\032\032google/ia" + + "m/v1/policy.proto\032\033google/protobuf/empty" + + ".proto\032 google/protobuf/field_mask.proto" + + "\"\263\001\n\026CreateNamespaceRequest\0229\n\006parent\030\001 " + + "\001(\tB)\340A\002\372A#\n!locations.googleapis.com/Lo" + + "cation\022\031\n\014namespace_id\030\002 \001(\tB\003\340A\002\022C\n\tnam" + + "espace\030\003 \001(\0132+.google.cloud.servicedirec" + + "tory.v1.NamespaceB\003\340A\002\"\257\001\n\025ListNamespace" + + "sRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locati" + + "ons.googleapis.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\006" + + "filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001" + + "\"r\n\026ListNamespacesResponse\022?\n\nnamespaces" + + "\030\001 \003(\0132+.google.cloud.servicedirectory.v" + + "1.Namespace\022\027\n\017next_page_token\030\002 \001(\t\"V\n\023" + + "GetNamespaceRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A" + + "+\n)servicedirectory.googleapis.com/Names" + + "pace\"\223\001\n\026UpdateNamespaceRequest\022C\n\tnames" + + "pace\030\001 \001(\0132+.google.cloud.servicedirecto" + + "ry.v1.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\"\263\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\022?\n\007service\030\003 \001(\0132).google.cloud.servi" + + "cedirectory.v1.ServiceB\003\340A\002\"\265\001\n\023ListServ" + + "icesRequest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+\n)ser" + + "vicedirectory.googleapis.com/Namespace\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\"l\n\024ListServicesResponse\022;\n\010s" + + "ervices\030\001 \003(\0132).google.cloud.servicedire" + + "ctory.v1.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.googleapis.com/Se" + + "rvice\"\215\001\n\024UpdateServiceRequest\022?\n\007servic" + + "e\030\001 \001(\0132).google.cloud.servicedirectory." + + "v1.ServiceB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMaskB\003\340A\002\"U\n\024DeleteS" + + "erviceRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'ser" + + "vicedirectory.googleapis.com/Service\"\265\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\022A\n\010end" + + "point\030\003 \001(\0132*.google.cloud.servicedirect" + + "ory.v1.EndpointB\003\340A\002\"\264\001\n\024ListEndpointsRe" + + "quest\022?\n\006parent\030\001 \001(\tB/\340A\002\372A)\n\'servicedi" + + "rectory.googleapis.com/Service\022\026\n\tpage_s" + + "ize\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\"o\n\025ListEndpointsResponse\022=\n\tendpoint" + + "s\030\001 \003(\0132*.google.cloud.servicedirectory." + + "v1.Endpoint\022\027\n\017next_page_token\030\002 \001(\t\"T\n\022" + + "GetEndpointRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*" + + "\n(servicedirectory.googleapis.com/Endpoi" + + "nt\"\220\001\n\025UpdateEndpointRequest\022A\n\010endpoint" + + "\030\001 \001(\0132*.google.cloud.servicedirectory.v" + + "1.EndpointB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMaskB\003\340A\002\"W\n\025DeleteE" + + "ndpointRequest\022>\n\004name\030\001 \001(\tB0\340A\002\372A*\n(se" + + "rvicedirectory.googleapis.com/Endpoint2\337" + + "\036\n\023RegistrationService\022\333\001\n\017CreateNamespa" + + "ce\0228.google.cloud.servicedirectory.v1.Cr" + + "eateNamespaceRequest\032+.google.cloud.serv" + + "icedirectory.v1.Namespace\"a\202\323\344\223\002;\"./v1/{" + + "parent=projects/*/locations/*}/namespace" + + "s:\tnamespace\332A\035parent,namespace,namespac" + + "e_id\022\304\001\n\016ListNamespaces\0227.google.cloud.s" + + "ervicedirectory.v1.ListNamespacesRequest" + + "\0328.google.cloud.servicedirectory.v1.List" + + "NamespacesResponse\"?\202\323\344\223\0020\022./v1/{parent=" + + "projects/*/locations/*}/namespaces\332A\006par" + + "ent\022\261\001\n\014GetNamespace\0225.google.cloud.serv" + + "icedirectory.v1.GetNamespaceRequest\032+.go" + + "ogle.cloud.servicedirectory.v1.Namespace" + + "\"=\202\323\344\223\0020\022./v1/{name=projects/*/locations" + + "/*/namespaces/*}\332A\004name\022\335\001\n\017UpdateNamesp" + + "ace\0228.google.cloud.servicedirectory.v1.U" + + "pdateNamespaceRequest\032+.google.cloud.ser" + + "vicedirectory.v1.Namespace\"c\202\323\344\223\002E28/v1/" + + "{namespace.name=projects/*/locations/*/n" + + "amespaces/*}:\tnamespace\332A\025namespace,upda" + + "te_mask\022\242\001\n\017DeleteNamespace\0228.google.clo" + + "ud.servicedirectory.v1.DeleteNamespaceRe" + + "quest\032\026.google.protobuf.Empty\"=\202\323\344\223\0020*./" + + "v1/{name=projects/*/locations/*/namespac" + + "es/*}\332A\004name\022\332\001\n\rCreateService\0226.google." + + "cloud.servicedirectory.v1.CreateServiceR" + + "equest\032).google.cloud.servicedirectory.v" + + "1.Service\"f\202\323\344\223\002D\"9/v1/{parent=projects/" + + "*/locations/*/namespaces/*}/services:\007se" + + "rvice\332A\031parent,service,service_id\022\311\001\n\014Li" + + "stServices\0225.google.cloud.servicedirecto" + + "ry.v1.ListServicesRequest\0326.google.cloud" + + ".servicedirectory.v1.ListServicesRespons" + + "e\"J\202\323\344\223\002;\0229/v1/{parent=projects/*/locati" + + "ons/*/namespaces/*}/services\332A\006parent\022\266\001" + + "\n\nGetService\0223.google.cloud.servicedirec" + + "tory.v1.GetServiceRequest\032).google.cloud" + + ".servicedirectory.v1.Service\"H\202\323\344\223\002;\0229/v" + + "1/{name=projects/*/locations/*/namespace" + + "s/*/services/*}\332A\004name\022\334\001\n\rUpdateService" + + "\0226.google.cloud.servicedirectory.v1.Upda" + + "teServiceRequest\032).google.cloud.serviced" + + "irectory.v1.Service\"h\202\323\344\223\002L2A/v1/{servic" + + "e.name=projects/*/locations/*/namespaces" + + "/*/services/*}:\007service\332A\023service,update" + + "_mask\022\251\001\n\rDeleteService\0226.google.cloud.s" + + "ervicedirectory.v1.DeleteServiceRequest\032" + + "\026.google.protobuf.Empty\"H\202\323\344\223\002;*9/v1/{na" + + "me=projects/*/locations/*/namespaces/*/s" + + "ervices/*}\332A\004name\022\354\001\n\016CreateEndpoint\0227.g" + + "oogle.cloud.servicedirectory.v1.CreateEn" + + "dpointRequest\032*.google.cloud.servicedire" + + "ctory.v1.Endpoint\"u\202\323\344\223\002Q\"E/v1/{parent=p" + + "rojects/*/locations/*/namespaces/*/servi" + + "ces/*}/endpoints:\010endpoint\332A\033parent,endp" + + "oint,endpoint_id\022\330\001\n\rListEndpoints\0226.goo" + + "gle.cloud.servicedirectory.v1.ListEndpoi" + + "ntsRequest\0327.google.cloud.servicedirecto" + + "ry.v1.ListEndpointsResponse\"V\202\323\344\223\002G\022E/v1" + + "/{parent=projects/*/locations/*/namespac" + + "es/*/services/*}/endpoints\332A\006parent\022\305\001\n\013" + + "GetEndpoint\0224.google.cloud.servicedirect" + + "ory.v1.GetEndpointRequest\032*.google.cloud" + + ".servicedirectory.v1.Endpoint\"T\202\323\344\223\002G\022E/" + + "v1/{name=projects/*/locations/*/namespac" + + "es/*/services/*/endpoints/*}\332A\004name\022\356\001\n\016" + + "UpdateEndpoint\0227.google.cloud.servicedir" + + "ectory.v1.UpdateEndpointRequest\032*.google" + + ".cloud.servicedirectory.v1.Endpoint\"w\202\323\344" + + "\223\002Z2N/v1/{endpoint.name=projects/*/locat" + + "ions/*/namespaces/*/services/*/endpoints" + + "/*}:\010endpoint\332A\024endpoint,update_mask\022\267\001\n" + + "\016DeleteEndpoint\0227.google.cloud.servicedi" + + "rectory.v1.DeleteEndpointRequest\032\026.googl" + + "e.protobuf.Empty\"T\202\323\344\223\002G*E/v1/{name=proj" + + "ects/*/locations/*/namespaces/*/services" + + "/*/endpoints/*}\332A\004name\022\350\001\n\014GetIamPolicy\022" + + "\".google.iam.v1.GetIamPolicyRequest\032\025.go" + + "ogle.iam.v1.Policy\"\234\001\202\323\344\223\002\225\001\"?/v1/{resou" + + "rce=projects/*/locations/*/namespaces/*}" + + ":getIamPolicy:\001*ZO\"J/v1/{resource=projec" + + "ts/*/locations/*/namespaces/*/services/*" + + "}:getIamPolicy:\001*\022\350\001\n\014SetIamPolicy\022\".goo" + + "gle.iam.v1.SetIamPolicyRequest\032\025.google." + + "iam.v1.Policy\"\234\001\202\323\344\223\002\225\001\"?/v1/{resource=p" + + "rojects/*/locations/*/namespaces/*}:setI" + + "amPolicy:\001*ZO\"J/v1/{resource=projects/*/" + + "locations/*/namespaces/*/services/*}:set" + + "IamPolicy:\001*\022\224\002\n\022TestIamPermissions\022(.go" + + "ogle.iam.v1.TestIamPermissionsRequest\032)." + + "google.iam.v1.TestIamPermissionsResponse" + + "\"\250\001\202\323\344\223\002\241\001\"E/v1/{resource=projects/*/loc" + + "ations/*/namespaces/*}:testIamPermission" + + "s:\001*ZU\"P/v1/{resource=projects/*/locatio" + + "ns/*/namespaces/*/services/*}:testIamPer" + + "missions:\001*\032S\312A\037servicedirectory.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformB\203\002\n$com.google.cloud.se" + + "rvicedirectory.v1B\030RegistrationServicePr" + + "otoP\001ZPgoogle.golang.org/genproto/google" + + "apis/cloud/servicedirectory/v1;servicedi" + + "rectory\370\001\001\252\002 Google.Cloud.ServiceDirecto" + + "ry.V1\312\002 Google\\Cloud\\ServiceDirectory\\V1" + + "\352\002#Google::Cloud::ServiceDirectory::V1b\006" + + "proto3" + }; + 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.v1.EndpointProto.getDescriptor(), + com.google.cloud.servicedirectory.v1.NamespaceProto.getDescriptor(), + com.google.cloud.servicedirectory.v1.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_v1_CreateNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_CreateNamespaceRequest_descriptor, + new java.lang.String[] { + "Parent", "NamespaceId", "Namespace", + }); + internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ListNamespacesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ListNamespacesResponse_descriptor, + new java.lang.String[] { + "Namespaces", "NextPageToken", + }); + internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_GetNamespaceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_descriptor, + new java.lang.String[] { + "Namespace", "UpdateMask", + }); + internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_DeleteNamespaceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_CreateServiceRequest_descriptor, + new java.lang.String[] { + "Parent", "ServiceId", "Service", + }); + internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ListServicesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ListServicesResponse_descriptor, + new java.lang.String[] { + "Services", "NextPageToken", + }); + internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_GetServiceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_descriptor, + new java.lang.String[] { + "Service", "UpdateMask", + }); + internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_DeleteServiceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_CreateEndpointRequest_descriptor, + new java.lang.String[] { + "Parent", "EndpointId", "Endpoint", + }); + internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ListEndpointsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_ListEndpointsResponse_descriptor, + new java.lang.String[] { + "Endpoints", "NextPageToken", + }); + internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_GetEndpointRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_descriptor, + new java.lang.String[] { + "Endpoint", "UpdateMask", + }); + internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_servicedirectory_v1_DeleteEndpointRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_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.v1.EndpointProto.getDescriptor(); + com.google.cloud.servicedirectory.v1.NamespaceProto.getDescriptor(); + com.google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequest.java new file mode 100644 index 00000000..30c5401d --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequest.java @@ -0,0 +1,1037 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService].
+ * Looks up a service by its name, returns the service and its endpoints.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ResolveServiceRequest} + */ +public final class ResolveServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ResolveServiceRequest.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to resolve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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.v1.ResolveServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ResolveServiceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.LookupService.ResolveService].
+   * Looks up a service by its name, returns the service and its endpoints.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ResolveServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ResolveServiceRequest) + com.google.cloud.servicedirectory.v1.ResolveServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ResolveServiceRequest.class, + com.google.cloud.servicedirectory.v1.ResolveServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ResolveServiceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ResolveServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ResolveServiceRequest build() { + com.google.cloud.servicedirectory.v1.ResolveServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ResolveServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.ResolveServiceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ResolveServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ResolveServiceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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.v1.ResolveServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ResolveServiceRequest) + private static final com.google.cloud.servicedirectory.v1.ResolveServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ResolveServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequestOrBuilder.java new file mode 100644 index 00000000..c7bd4fe9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ResolveServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponse.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponse.java new file mode 100644 index 00000000..eb981371 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponse.java @@ -0,0 +1,649 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/servicedirectory/v1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The response message for
+ * [LookupService.ResolveService][google.cloud.servicedirectory.v1.LookupService.ResolveService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ResolveServiceResponse} + */ +public final class ResolveServiceResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ResolveServiceResponse.class, + com.google.cloud.servicedirectory.v1.ResolveServiceResponse.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1.Service service_; + /** + * .google.cloud.servicedirectory.v1.Service service = 1; + * + * @return Whether the service field is set. + */ + @java.lang.Override + public boolean hasService() { + return service_ != null; + } + /** + * .google.cloud.servicedirectory.v1.Service service = 1; + * + * @return The service. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service getService() { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.ResolveServiceResponse other = + (com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.LookupService.ResolveService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.ResolveServiceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.ResolveServiceResponse) + com.google.cloud.servicedirectory.v1.ResolveServiceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.ResolveServiceResponse.class, + com.google.cloud.servicedirectory.v1.ResolveServiceResponse.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.LookupServiceProto + .internal_static_google_cloud_servicedirectory_v1_ResolveServiceResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ResolveServiceResponse getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.ResolveServiceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ResolveServiceResponse build() { + com.google.cloud.servicedirectory.v1.ResolveServiceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.ResolveServiceResponse buildPartial() { + com.google.cloud.servicedirectory.v1.ResolveServiceResponse result = + new com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse) { + return mergeFrom((com.google.cloud.servicedirectory.v1.ResolveServiceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.ResolveServiceResponse other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.ResolveServiceResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + serviceBuilder_; + /** + * .google.cloud.servicedirectory.v1.Service service = 1; + * + * @return Whether the service field is set. + */ + public boolean hasService() { + return serviceBuilder_ != null || service_ != null; + } + /** + * .google.cloud.servicedirectory.v1.Service service = 1; + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + public Builder setService(com.google.cloud.servicedirectory.v1.Service value) { + if (serviceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + onChanged(); + } else { + serviceBuilder_.setMessage(value); + } + + return this; + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + public Builder setService( + com.google.cloud.servicedirectory.v1.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + public Builder mergeService(com.google.cloud.servicedirectory.v1.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.cloud.servicedirectory.v1.Service.newBuilder(service_) + .mergeFrom(value) + .buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + public Builder clearService() { + if (serviceBuilder_ == null) { + service_ = null; + onChanged(); + } else { + service_ = null; + serviceBuilder_ = null; + } + + return this; + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + public com.google.cloud.servicedirectory.v1.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + public com.google.cloud.servicedirectory.v1.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } + } + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.ResolveServiceResponse) + private static final com.google.cloud.servicedirectory.v1.ResolveServiceResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.ResolveServiceResponse(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.ResolveServiceResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponseOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponseOrBuilder.java new file mode 100644 index 00000000..63509e49 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/lookup_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ResolveServiceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.ResolveServiceResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.cloud.servicedirectory.v1.Service service = 1; + * + * @return Whether the service field is set. + */ + boolean hasService(); + /** + * .google.cloud.servicedirectory.v1.Service service = 1; + * + * @return The service. + */ + com.google.cloud.servicedirectory.v1.Service getService(); + /** .google.cloud.servicedirectory.v1.Service service = 1; */ + com.google.cloud.servicedirectory.v1.ServiceOrBuilder getServiceOrBuilder(); +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Service.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Service.java new file mode 100644 index 00000000..3927db97 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Service.java @@ -0,0 +1,1792 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * An individual service. A service contains a name and optional metadata.
+ * A service must exist before
+ * [endpoints][google.cloud.servicedirectory.v1.Endpoint] can be
+ * added to it.
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.Service} + */ +public final class Service extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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 26: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + endpoints_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + endpoints_.add( + input.readMessage( + com.google.cloud.servicedirectory.v1.Endpoint.parser(), extensionRegistry)); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + annotations_ = + com.google.protobuf.MapField.newMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + annotations_.getMutableMap().put(annotations__.getKey(), annotations__.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 { + 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.v1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1_Service_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.Service.class, + com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * 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. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 4; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.servicedirectory.v1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1_Service_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + 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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + 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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + 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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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_); + } + for (int i = 0; i < endpoints_.size(); i++) { + output.writeMessage(3, endpoints_.get(i)); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.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_); + } + for (int i = 0; i < endpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, endpoints_.get(i)); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, annotations__); + } + 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.v1.Service)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.Service other = + (com.google.cloud.servicedirectory.v1.Service) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) 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 (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().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.v1.Service parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Service parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Service parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Service parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Service parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Endpoint] can be
+   * added to it.
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.Service} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.Service) + com.google.cloud.servicedirectory.v1.ServiceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1_Service_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1_Service_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.Service.class, + com.google.cloud.servicedirectory.v1.Service.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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_ = ""; + + internalGetMutableAnnotations().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.v1.ServiceProto + .internal_static_google_cloud_servicedirectory_v1_Service_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.Service.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service build() { + com.google.cloud.servicedirectory.v1.Service result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service buildPartial() { + com.google.cloud.servicedirectory.v1.Service result = + new com.google.cloud.servicedirectory.v1.Service(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.annotations_ = internalGetAnnotations(); + result.annotations_.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.v1.Service) { + return mergeFrom((com.google.cloud.servicedirectory.v1.Service) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.Service other) { + if (other == com.google.cloud.servicedirectory.v1.Service.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + 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.v1.Service parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.servicedirectory.v1.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 annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + onChanged(); + ; + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Optional. Annotations for the service. This data can be consumed by service
+     * clients.
+     * Restrictions:
+     *  - The entire annotations dictionary may contain up to 2000 characters,
+     *    spread accoss all key-value pairs. Annotations that goes beyond any
+     *    these limits will be rejected.
+     *  - Valid annotation keys have two segments: an optional prefix and name,
+     *    separated by a slash (/). The name segment is required and must be 63
+     *    characters or less, beginning and ending with an alphanumeric character
+     *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+     *    alphanumerics between. The prefix is optional. If specified, the prefix
+     *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+     *    not longer than 253 characters in total, followed by a slash (/).
+     *    Annotations that fails to meet these requirements will be rejected.
+     *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+     *    for system annotations managed by Service Directory. If the user tries
+     *    to write to these keyspaces, those entries will be silently ignored by
+     *    the system.
+     * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+     * They have the same syntax and read/write to the same location in Service
+     * Directory.
+     * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().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.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on
+     * LookupService.Resolve. Control plane clients should use
+     * RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1.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.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndpoints(int index, com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndpoints( + int index, com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints(com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints(int index, com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints( + com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEndpoints( + int index, com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1.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.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder(com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on
+     * LookupService.Resolve. Control plane clients should use
+     * RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder addEndpointsBuilder(int index) { + return getEndpointsFieldBuilder() + .addBuilder(index, com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints associated with this service. Returned on
+     * LookupService.Resolve. Control plane clients should use
+     * RegistrationService.ListEndpoints.
+     * 
+ * + * + * repeated .google.cloud.servicedirectory.v1.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.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.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.v1.Service) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.Service) + private static final com.google.cloud.servicedirectory.v1.Service DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.Service(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.Service getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceName.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceName.java new file mode 100644 index 00000000..778ecc77 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** 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-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceOrBuilder.java new file mode 100644 index 00000000..fc770c5a --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceOrBuilder.java @@ -0,0 +1,283 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/v1/service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface ServiceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.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. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Annotations for the service. This data can be consumed by service
+   * clients.
+   * Restrictions:
+   *  - The entire annotations dictionary may contain up to 2000 characters,
+   *    spread accoss all key-value pairs. Annotations that goes beyond any
+   *    these limits will be rejected.
+   *  - Valid annotation keys have two segments: an optional prefix and name,
+   *    separated by a slash (/). The name segment is required and must be 63
+   *    characters or less, beginning and ending with an alphanumeric character
+   *    ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and
+   *    alphanumerics between. The prefix is optional. If specified, the prefix
+   *    must be a DNS subdomain: a series of DNS labels separated by dots (.),
+   *    not longer than 253 characters in total, followed by a slash (/).
+   *    Annotations that fails to meet these requirements will be rejected.
+   *  - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved
+   *    for system annotations managed by Service Directory. If the user tries
+   *    to write to these keyspaces, those entries will be silently ignored by
+   *    the system.
+   * Note: This field is equivalent to the 'metadata' field in the v1beta1 API.
+   * They have the same syntax and read/write to the same location in Service
+   * Directory.
+   * 
+ * + * map<string, string> annotations = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(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.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.Endpoint endpoints = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.servicedirectory.v1.EndpointOrBuilder getEndpointsOrBuilder(int index); +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceProto.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceProto.java new file mode 100644 index 00000000..dd565997 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/service.proto + +package com.google.cloud.servicedirectory.v1; + +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_v1_Service_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_Service_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_servicedirectory_v1_Service_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_servicedirectory_v1_Service_AnnotationsEntry_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/v1/servi" + + "ce.proto\022 google.cloud.servicedirectory." + + "v1\032\034google/api/annotations.proto\032\037google" + + "/api/field_behavior.proto\032\031google/api/re" + + "source.proto\032/google/cloud/servicedirect" + + "ory/v1/endpoint.proto\"\353\002\n\007Service\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\005\022T\n\013annotations\030\004 \003(\0132:.goog" + + "le.cloud.servicedirectory.v1.Service.Ann" + + "otationsEntryB\003\340A\001\022B\n\tendpoints\030\003 \003(\0132*." + + "google.cloud.servicedirectory.v1.Endpoin" + + "tB\003\340A\003\0322\n\020AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001:\177\352A|\n\'servicedirector" + + "y.googleapis.com/Service\022Qprojects/{proj" + + "ect}/locations/{location}/namespaces/{na" + + "mespace}/services/{service}B\367\001\n$com.goog" + + "le.cloud.servicedirectory.v1B\014ServicePro" + + "toP\001ZPgoogle.golang.org/genproto/googlea" + + "pis/cloud/servicedirectory/v1;servicedir" + + "ectory\370\001\001\252\002 Google.Cloud.ServiceDirector" + + "y.V1\312\002 Google\\Cloud\\ServiceDirectory\\V1\352" + + "\002#Google::Cloud::ServiceDirectory::V1b\006p" + + "roto3" + }; + 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.v1.EndpointProto.getDescriptor(), + }); + internal_static_google_cloud_servicedirectory_v1_Service_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_servicedirectory_v1_Service_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_Service_descriptor, + new java.lang.String[] { + "Name", "Annotations", "Endpoints", + }); + internal_static_google_cloud_servicedirectory_v1_Service_AnnotationsEntry_descriptor = + internal_static_google_cloud_servicedirectory_v1_Service_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_servicedirectory_v1_Service_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_servicedirectory_v1_Service_AnnotationsEntry_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.AnnotationsProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.servicedirectory.v1.EndpointProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateEndpointRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateEndpointRequest.java new file mode 100644 index 00000000..ba78fcfc --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.UpdateEndpoint][google.cloud.servicedirectory.v1.RegistrationService.UpdateEndpoint].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.UpdateEndpointRequest} + */ +public final class UpdateEndpointRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Endpoint.Builder subBuilder = null; + if (endpoint_ != null) { + subBuilder = endpoint_.toBuilder(); + } + endpoint_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest.class, + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest.Builder.class); + } + + public static final int ENDPOINT_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1.Endpoint endpoint_; + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + @java.lang.Override + public boolean hasEndpoint() { + return endpoint_ != null; + } + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoint() { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance() + : endpoint_; + } + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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]; + * + */ + @java.lang.Override + 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.v1.UpdateEndpointRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.UpdateEndpoint].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.UpdateEndpointRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.UpdateEndpointRequest) + com.google.cloud.servicedirectory.v1.UpdateEndpointRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest.class, + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateEndpointRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateEndpointRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.UpdateEndpointRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateEndpointRequest build() { + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateEndpointRequest buildPartial() { + com.google.cloud.servicedirectory.v1.UpdateEndpointRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.UpdateEndpointRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.UpdateEndpointRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.UpdateEndpointRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1.Endpoint endpoint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + endpointBuilder_; + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + public com.google.cloud.servicedirectory.v1.Endpoint getEndpoint() { + if (endpointBuilder_ == null) { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance() + : endpoint_; + } else { + return endpointBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint(com.google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEndpoint( + com.google.cloud.servicedirectory.v1.Endpoint.Builder builderForValue) { + if (endpointBuilder_ == null) { + endpoint_ = builderForValue.build(); + onChanged(); + } else { + endpointBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEndpoint(com.google.cloud.servicedirectory.v1.Endpoint value) { + if (endpointBuilder_ == null) { + if (endpoint_ != null) { + endpoint_ = + com.google.cloud.servicedirectory.v1.Endpoint.newBuilder(endpoint_) + .mergeFrom(value) + .buildPartial(); + } else { + endpoint_ = value; + } + onChanged(); + } else { + endpointBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.Endpoint.Builder getEndpointBuilder() { + + onChanged(); + return getEndpointFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.EndpointOrBuilder getEndpointOrBuilder() { + if (endpointBuilder_ != null) { + return endpointBuilder_.getMessageOrBuilder(); + } else { + return endpoint_ == null + ? com.google.cloud.servicedirectory.v1.Endpoint.getDefaultInstance() + : endpoint_; + } + } + /** + * + * + *
+     * Required. The updated endpoint.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.EndpointOrBuilder> + getEndpointFieldBuilder() { + if (endpointBuilder_ == null) { + endpointBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Endpoint, + com.google.cloud.servicedirectory.v1.Endpoint.Builder, + com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.UpdateEndpointRequest) + private static final com.google.cloud.servicedirectory.v1.UpdateEndpointRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.UpdateEndpointRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateEndpointRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateEndpointRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateEndpointRequestOrBuilder.java new file mode 100644 index 00000000..45fe649c --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface UpdateEndpointRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.UpdateEndpointRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the endpoint field is set. + */ + boolean hasEndpoint(); + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The endpoint. + */ + com.google.cloud.servicedirectory.v1.Endpoint getEndpoint(); + /** + * + * + *
+   * Required. The updated endpoint.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Endpoint endpoint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateNamespaceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateNamespaceRequest.java new file mode 100644 index 00000000..4c9b45c7 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.UpdateNamespace][google.cloud.servicedirectory.v1.RegistrationService.UpdateNamespace].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.UpdateNamespaceRequest} + */ +public final class UpdateNamespaceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Namespace.Builder subBuilder = null; + if (namespace_ != null) { + subBuilder = namespace_.toBuilder(); + } + namespace_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest.Builder.class); + } + + public static final int NAMESPACE_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1.Namespace namespace_; + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + @java.lang.Override + public boolean hasNamespace() { + return namespace_ != null; + } + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Namespace getNamespace() { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance() + : namespace_; + } + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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]; + * + */ + @java.lang.Override + 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.v1.UpdateNamespaceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.UpdateNamespace].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.UpdateNamespaceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.UpdateNamespaceRequest) + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest.class, + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateNamespaceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest build() { + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1.Namespace namespace_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder> + namespaceBuilder_; + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + public com.google.cloud.servicedirectory.v1.Namespace getNamespace() { + if (namespaceBuilder_ == null) { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance() + : namespace_; + } else { + return namespaceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace(com.google.cloud.servicedirectory.v1.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.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setNamespace( + com.google.cloud.servicedirectory.v1.Namespace.Builder builderForValue) { + if (namespaceBuilder_ == null) { + namespace_ = builderForValue.build(); + onChanged(); + } else { + namespaceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeNamespace(com.google.cloud.servicedirectory.v1.Namespace value) { + if (namespaceBuilder_ == null) { + if (namespace_ != null) { + namespace_ = + com.google.cloud.servicedirectory.v1.Namespace.newBuilder(namespace_) + .mergeFrom(value) + .buildPartial(); + } else { + namespace_ = value; + } + onChanged(); + } else { + namespaceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.Namespace.Builder getNamespaceBuilder() { + + onChanged(); + return getNamespaceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.NamespaceOrBuilder getNamespaceOrBuilder() { + if (namespaceBuilder_ != null) { + return namespaceBuilder_.getMessageOrBuilder(); + } else { + return namespace_ == null + ? com.google.cloud.servicedirectory.v1.Namespace.getDefaultInstance() + : namespace_; + } + } + /** + * + * + *
+     * Required. The updated namespace.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.NamespaceOrBuilder> + getNamespaceFieldBuilder() { + if (namespaceBuilder_ == null) { + namespaceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Namespace, + com.google.cloud.servicedirectory.v1.Namespace.Builder, + com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.UpdateNamespaceRequest) + private static final com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.UpdateNamespaceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateNamespaceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateNamespaceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateNamespaceRequestOrBuilder.java new file mode 100644 index 00000000..52684264 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface UpdateNamespaceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.UpdateNamespaceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the namespace field is set. + */ + boolean hasNamespace(); + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The namespace. + */ + com.google.cloud.servicedirectory.v1.Namespace getNamespace(); + /** + * + * + *
+   * Required. The updated namespace.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Namespace namespace = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1.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-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequest.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequest.java new file mode 100644 index 00000000..ad3785d9 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequest.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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +/** + * + * + *
+ * The request message for
+ * [RegistrationService.UpdateService][google.cloud.servicedirectory.v1.RegistrationService.UpdateService].
+ * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.UpdateServiceRequest} + */ +public final class UpdateServiceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.servicedirectory.v1.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.v1.Service.Builder subBuilder = null; + if (service_ != null) { + subBuilder = service_.toBuilder(); + } + service_ = + input.readMessage( + com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.UpdateServiceRequest.class, + com.google.cloud.servicedirectory.v1.UpdateServiceRequest.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private com.google.cloud.servicedirectory.v1.Service service_; + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + @java.lang.Override + public boolean hasService() { + return service_ != null; + } + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.Service getService() { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.servicedirectory.v1.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. + */ + @java.lang.Override + 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. + */ + @java.lang.Override + 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]; + * + */ + @java.lang.Override + 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.v1.UpdateServiceRequest)) { + return super.equals(obj); + } + com.google.cloud.servicedirectory.v1.UpdateServiceRequest other = + (com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.RegistrationService.UpdateService].
+   * 
+ * + * Protobuf type {@code google.cloud.servicedirectory.v1.UpdateServiceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.servicedirectory.v1.UpdateServiceRequest) + com.google.cloud.servicedirectory.v1.UpdateServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.servicedirectory.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.servicedirectory.v1.UpdateServiceRequest.class, + com.google.cloud.servicedirectory.v1.UpdateServiceRequest.Builder.class); + } + + // Construct using com.google.cloud.servicedirectory.v1.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.v1.RegistrationServiceProto + .internal_static_google_cloud_servicedirectory_v1_UpdateServiceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateServiceRequest getDefaultInstanceForType() { + return com.google.cloud.servicedirectory.v1.UpdateServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateServiceRequest build() { + com.google.cloud.servicedirectory.v1.UpdateServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.servicedirectory.v1.UpdateServiceRequest buildPartial() { + com.google.cloud.servicedirectory.v1.UpdateServiceRequest result = + new com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest) { + return mergeFrom((com.google.cloud.servicedirectory.v1.UpdateServiceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.servicedirectory.v1.UpdateServiceRequest other) { + if (other == com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.servicedirectory.v1.UpdateServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.servicedirectory.v1.Service service_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + serviceBuilder_; + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + public com.google.cloud.servicedirectory.v1.Service getService() { + if (serviceBuilder_ == null) { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } else { + return serviceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService(com.google.cloud.servicedirectory.v1.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.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setService( + com.google.cloud.servicedirectory.v1.Service.Builder builderForValue) { + if (serviceBuilder_ == null) { + service_ = builderForValue.build(); + onChanged(); + } else { + serviceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeService(com.google.cloud.servicedirectory.v1.Service value) { + if (serviceBuilder_ == null) { + if (service_ != null) { + service_ = + com.google.cloud.servicedirectory.v1.Service.newBuilder(service_) + .mergeFrom(value) + .buildPartial(); + } else { + service_ = value; + } + onChanged(); + } else { + serviceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.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.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.Service.Builder getServiceBuilder() { + + onChanged(); + return getServiceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.servicedirectory.v1.ServiceOrBuilder getServiceOrBuilder() { + if (serviceBuilder_ != null) { + return serviceBuilder_.getMessageOrBuilder(); + } else { + return service_ == null + ? com.google.cloud.servicedirectory.v1.Service.getDefaultInstance() + : service_; + } + } + /** + * + * + *
+     * Required. The updated service.
+     * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.ServiceOrBuilder> + getServiceFieldBuilder() { + if (serviceBuilder_ == null) { + serviceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.servicedirectory.v1.Service, + com.google.cloud.servicedirectory.v1.Service.Builder, + com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.servicedirectory.v1.UpdateServiceRequest) + private static final com.google.cloud.servicedirectory.v1.UpdateServiceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.servicedirectory.v1.UpdateServiceRequest(); + } + + public static com.google.cloud.servicedirectory.v1.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.v1.UpdateServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequestOrBuilder.java b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequestOrBuilder.java new file mode 100644 index 00000000..8b16b5cd --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/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/v1/registration_service.proto + +package com.google.cloud.servicedirectory.v1; + +public interface UpdateServiceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.servicedirectory.v1.UpdateServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the service field is set. + */ + boolean hasService(); + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The service. + */ + com.google.cloud.servicedirectory.v1.Service getService(); + /** + * + * + *
+   * Required. The updated service.
+   * 
+ * + * + * .google.cloud.servicedirectory.v1.Service service = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.servicedirectory.v1.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-v1/src/main/proto/google/cloud/servicedirectory/v1/endpoint.proto b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/endpoint.proto new file mode 100644 index 00000000..1f867006 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/endpoint.proto @@ -0,0 +1,75 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceDirectory.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "EndpointProto"; +option java_package = "com.google.cloud.servicedirectory.v1"; +option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1"; +option ruby_package = "Google::Cloud::ServiceDirectory::V1"; + +// An individual endpoint that provides a +// [service][google.cloud.servicedirectory.v1.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. Annotations for the endpoint. This data can be consumed by + // service clients. Restrictions: + // - The entire annotations dictionary may contain up to 512 characters, + // spread accoss all key-value pairs. Annotations that goes beyond any + // these limits will be rejected. + // - Valid annotation keys have two segments: an optional prefix and name, + // separated by a slash (/). The name segment is required and must be 63 + // characters or less, beginning and ending with an alphanumeric character + // ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + // alphanumerics between. The prefix is optional. If specified, the prefix + // must be a DNS subdomain: a series of DNS labels separated by dots (.), + // not longer than 253 characters in total, followed by a slash (/). + // Annotations that fails to meet these requirements will be rejected. + // - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved + // for system annotations managed by Service Directory. If the user tries + // to write to these keyspaces, those entries will be silently ignored by + // the system. + // Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + // They have the same syntax and read/write to the same location in Service + // Directory. + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/lookup_service.proto b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/lookup_service.proto new file mode 100644 index 00000000..c51582b3 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/lookup_service.proto @@ -0,0 +1,93 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/servicedirectory/v1/service.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceDirectory.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "LookupServiceProto"; +option java_package = "com.google.cloud.servicedirectory.v1"; +option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1"; +option ruby_package = "Google::Cloud::ServiceDirectory::V1"; + +// 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.v1.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: "/v1/{name=projects/*/locations/*/namespaces/*/services/*}:resolve" + body: "*" + }; + } +} + +// The request message for +// [LookupService.ResolveService][google.cloud.servicedirectory.v1.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.v1.LookupService.ResolveService]. +message ResolveServiceResponse { + Service service = 1; +} diff --git a/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/namespace.proto b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/namespace.proto new file mode 100644 index 00000000..bd7f8148 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/namespace.proto @@ -0,0 +1,49 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceDirectory.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "NamespaceProto"; +option java_package = "com.google.cloud.servicedirectory.v1"; +option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1"; +option ruby_package = "Google::Cloud::ServiceDirectory::V1"; + +// A container for [services][google.cloud.servicedirectory.v1.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-v1/src/main/proto/google/cloud/servicedirectory/v1/registration_service.proto b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/registration_service.proto new file mode 100644 index 00000000..8c0a61a7 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/registration_service.proto @@ -0,0 +1,595 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/servicedirectory/v1/endpoint.proto"; +import "google/cloud/servicedirectory/v1/namespace.proto"; +import "google/cloud/servicedirectory/v1/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 csharp_namespace = "Google.Cloud.ServiceDirectory.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "RegistrationServiceProto"; +option java_package = "com.google.cloud.servicedirectory.v1"; +option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1"; +option ruby_package = "Google::Cloud::ServiceDirectory::V1"; + +// Service Directory API for registering services. It defines the following +// resource model: +// +// - The API has a collection of +// [Namespace][google.cloud.servicedirectory.v1.Namespace] +// resources, named `projects/*/locations/*/namespaces/*`. +// +// - Each Namespace has a collection of +// [Service][google.cloud.servicedirectory.v1.Service] resources, named +// `projects/*/locations/*/namespaces/*/services/*`. +// +// - Each Service has a collection of +// [Endpoint][google.cloud.servicedirectory.v1.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: "/v1/{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: "/v1/{parent=projects/*/locations/*}/namespaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a namespace. + rpc GetNamespace(GetNamespaceRequest) returns (Namespace) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/namespaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a namespace. + rpc UpdateNamespace(UpdateNamespaceRequest) returns (Namespace) { + option (google.api.http) = { + patch: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{parent=projects/*/locations/*/namespaces/*}/services" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a service. + rpc GetService(GetServiceRequest) returns (Service) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/namespaces/*/services/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a service. + rpc UpdateService(UpdateServiceRequest) returns (Service) { + option (google.api.http) = { + patch: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{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: "/v1/{resource=projects/*/locations/*/namespaces/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{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: "/v1/{resource=projects/*/locations/*/namespaces/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{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: "/v1/{resource=projects/*/locations/*/namespaces/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/locations/*/namespaces/*/services/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// The request message for +// [RegistrationService.CreateNamespace][google.cloud.servicedirectory.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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-v1/src/main/proto/google/cloud/servicedirectory/v1/service.proto b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/service.proto new file mode 100644 index 00000000..81f60af8 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/service.proto @@ -0,0 +1,74 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/servicedirectory/v1/endpoint.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.ServiceDirectory.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/servicedirectory/v1;servicedirectory"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.servicedirectory.v1"; +option php_namespace = "Google\\Cloud\\ServiceDirectory\\V1"; +option ruby_package = "Google::Cloud::ServiceDirectory::V1"; + +// An individual service. A service contains a name and optional metadata. +// A service must exist before +// [endpoints][google.cloud.servicedirectory.v1.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. Annotations for the service. This data can be consumed by service + // clients. + // Restrictions: + // - The entire annotations dictionary may contain up to 2000 characters, + // spread accoss all key-value pairs. Annotations that goes beyond any + // these limits will be rejected. + // - Valid annotation keys have two segments: an optional prefix and name, + // separated by a slash (/). The name segment is required and must be 63 + // characters or less, beginning and ending with an alphanumeric character + // ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and + // alphanumerics between. The prefix is optional. If specified, the prefix + // must be a DNS subdomain: a series of DNS labels separated by dots (.), + // not longer than 253 characters in total, followed by a slash (/). + // Annotations that fails to meet these requirements will be rejected. + // - The '(*.)google.com/' and '(*.)googleapis.com/' prefixes are reserved + // for system annotations managed by Service Directory. If the user tries + // to write to these keyspaces, those entries will be silently ignored by + // the system. + // Note: This field is equivalent to the 'metadata' field in the v1beta1 API. + // They have the same syntax and read/write to the same location in Service + // Directory. + map annotations = 4 [(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/proto-google-cloud-servicedirectory-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-servicedirectory-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 00000000..5923fda7 --- /dev/null +++ b/proto-google-cloud-servicedirectory-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/servicedirectory/v1beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/servicedirectory/v1beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/servicedirectory/v1beta1/*OrBuilder + boolean has*(*) + + diff --git a/synth.metadata b/synth.metadata index 50748066..4d6b2e2c 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,23 +3,31 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/java-servicedirectory.git", - "sha": "0fc81d548a8c732f5b9aa1f32273f8a7e2bf4c63" + "remote": "git@github.com:googleapis/java-servicedirectory.git", + "sha": "2926c88bd413160d3821b18234263eae035f25fc" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "98d6efce2ba341bcb6e5319e082a9109b51555c7", - "internalRef": "319092903" + "sha": "8d245ac97e058b541f1477b1a85d676b18e80849", + "internalRef": "342580339" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "8d245ac97e058b541f1477b1a85d676b18e80849", + "internalRef": "342580339" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7d652819519dfa24da9e14548232e4aaba71a11c" + "sha": "d5fc0bcf9ea9789c5b0e3154a9e3b29e5cea6116" } } ], @@ -32,6 +40,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "servicedirectory", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } } ], "generatedFiles": [ @@ -100,6 +117,19 @@ "CONTRIBUTING.md", "LICENSE", "codecov.yaml", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceClient.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceSettings.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceClient.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceSettings.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/package-info.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcLookupServiceCallableFactory.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcLookupServiceStub.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcRegistrationServiceCallableFactory.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/GrpcRegistrationServiceStub.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/LookupServiceStub.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/LookupServiceStubSettings.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/RegistrationServiceStub.java", + "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1/stub/RegistrationServiceStubSettings.java", "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java", "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceSettings.java", "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java", @@ -113,16 +143,84 @@ "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/LookupServiceStubSettings.java", "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStub.java", "google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/RegistrationServiceStubSettings.java", + "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/LookupServiceClientTest.java", + "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockLookupService.java", + "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockLookupServiceImpl.java", + "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockRegistrationService.java", + "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/MockRegistrationServiceImpl.java", + "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1/RegistrationServiceClientTest.java", "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClientTest.java", "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupService.java", "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java", "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationService.java", "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java", "google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClientTest.java", + "grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceGrpc.java", + "grpc-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceGrpc.java", "grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceGrpc.java", "grpc-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceGrpc.java", "java.header", "license-checks.xml", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateEndpointRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateNamespaceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/CreateServiceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteEndpointRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteNamespaceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/DeleteServiceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Endpoint.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointName.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/EndpointProto.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetEndpointRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetNamespaceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetNamespaceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/GetServiceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponse.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListEndpointsResponseOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponse.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListNamespacesResponseOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponse.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ListServicesResponseOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LocationName.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/LookupServiceProto.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Namespace.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceName.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/NamespaceProto.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/RegistrationServiceProto.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponse.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ResolveServiceResponseOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/Service.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceName.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/ServiceProto.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateEndpointRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateEndpointRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateNamespaceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateNamespaceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequest.java", + "proto-google-cloud-servicedirectory-v1/src/main/java/com/google/cloud/servicedirectory/v1/UpdateServiceRequestOrBuilder.java", + "proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/endpoint.proto", + "proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/lookup_service.proto", + "proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/namespace.proto", + "proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/registration_service.proto", + "proto-google-cloud-servicedirectory-v1/src/main/proto/google/cloud/servicedirectory/v1/service.proto", "proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequest.java", "proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateEndpointRequestOrBuilder.java", "proto-google-cloud-servicedirectory-v1beta1/src/main/java/com/google/cloud/servicedirectory/v1beta1/CreateNamespaceRequest.java", diff --git a/synth.py b/synth.py index 3cde1945..e57c7a3e 100644 --- a/synth.py +++ b/synth.py @@ -14,14 +14,12 @@ """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 AUTOSYNTH_MULTIPLE_COMMITS = True service = 'servicedirectory' -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] for version in versions: java.bazel_library( diff --git a/versions.txt b/versions.txt index fd443b45..fd62dad0 100644 --- a/versions.txt +++ b/versions.txt @@ -2,5 +2,7 @@ # module:released-version:current-version proto-google-cloud-servicedirectory-v1beta1:0.2.8:0.2.9-SNAPSHOT +proto-google-cloud-servicedirectory-v1:0.2.8:0.2.9-SNAPSHOT grpc-google-cloud-servicedirectory-v1beta1:0.2.8:0.2.9-SNAPSHOT +grpc-google-cloud-servicedirectory-v1:0.2.8:0.2.9-SNAPSHOT google-cloud-servicedirectory:0.2.8:0.2.9-SNAPSHOT