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: + * + *
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 UnaryCallableThe 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 ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction - 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:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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 createNamespace to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * 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:
+ *
+ * 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 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 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 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
+ *
+ *
+ *
+ * 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);
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ * RegistrationServiceSettings registrationServiceSettings =
+ * RegistrationServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .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.
+ *
+ *
+ * RegistrationServiceSettings registrationServiceSettings =
+ * RegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegistrationServiceClient registrationServiceClient =
+ * RegistrationServiceClient.create(registrationServiceSettings);
+ *
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(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.
+ *
+ *
+ * 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 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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String parent) {
+ ListNamespacesRequest request = ListNamespacesRequest.newBuilder().setParent(parent).build();
+ return listNamespaces(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all namespaces.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Namespace element : registrationServiceClient.listNamespaces(parent.toString()).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.
+ *
+ *
+ * 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);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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
+ * 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;
+ * }
+ * }
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String name) {
+ GetNamespaceRequest request = GetNamespaceRequest.newBuilder().setName(name).build();
+ return getNamespace(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a namespace.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+ * Namespace response = registrationServiceClient.getNamespace(name.toString());
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * Namespace namespace = Namespace.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Namespace response = registrationServiceClient.updateNamespace(namespace, updateMask);
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+ * registrationServiceClient.deleteNamespace(name.toString());
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+ * DeleteNamespaceRequest request = DeleteNamespaceRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * registrationServiceClient.deleteNamespace(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(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.
+ *
+ *
+ * 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 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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String parent) {
+ ListServicesRequest request = ListServicesRequest.newBuilder().setParent(parent).build();
+ return listServices(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all services belonging to a namespace.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+ * for (Service element : registrationServiceClient.listServices(parent.toString()).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.
+ *
+ *
+ * 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);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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
+ * 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;
+ * }
+ * }
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String name) {
+ GetServiceRequest request = GetServiceRequest.newBuilder().setName(name).build();
+ return getService(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a service.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+ * Service response = registrationServiceClient.getService(name.toString());
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * Service service = Service.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Service response = registrationServiceClient.updateService(service, updateMask);
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+ * registrationServiceClient.deleteService(name.toString());
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+ * DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * registrationServiceClient.deleteService(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(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.
+ *
+ *
+ * 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 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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String parent) {
+ ListEndpointsRequest request = ListEndpointsRequest.newBuilder().setParent(parent).build();
+ return listEndpoints(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all endpoints.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+ * for (Endpoint element : registrationServiceClient.listEndpoints(parent.toString()).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.
+ *
+ *
+ * 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);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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
+ * 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;
+ * }
+ * }
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String name) {
+ GetEndpointRequest request = GetEndpointRequest.newBuilder().setName(name).build();
+ return getEndpoint(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a endpoint.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+ * Endpoint response = registrationServiceClient.getEndpoint(name.toString());
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * Endpoint endpoint = Endpoint.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Endpoint response = registrationServiceClient.updateEndpoint(endpoint, updateMask);
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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(String name) {
+ DeleteEndpointRequest request = DeleteEndpointRequest.newBuilder().setName(name).build();
+ deleteEndpoint(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a endpoint.
+ *
+ *
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
+ * registrationServiceClient.deleteEndpoint(name.toString());
+ * }
+ *
+ *
+ * @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.
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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).
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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).
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ * @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).
+ *
+ *
+ * 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);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * 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();
+ * }
+ *
+ *
+ *
+ *
+ *
+ */
+@Generated("by gapic-generator")
+@BetaApi
+public class RegistrationServiceSettings extends ClientSettings
+ * RegistrationServiceSettings.Builder registrationServiceSettingsBuilder =
+ * RegistrationServiceSettings.newBuilder();
+ * registrationServiceSettingsBuilder
+ * .createNamespaceSettings()
+ * .setRetrySettings(
+ * registrationServiceSettingsBuilder.createNamespaceSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * RegistrationServiceSettings registrationServiceSettings = registrationServiceSettingsBuilder.build();
+ *
+ *
+ *
+ *
+ * ========================= RegistrationServiceClient =========================
+ *
+ *
+ * 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);
+ * }
+ *
+ *
+ *
+ */
+@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.
+ *
+ *
+ * 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);
+ * }
+ *
+ *