From 399530b658bba7150b42d7fbedec79d109b4e9e6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 19 Feb 2021 12:08:07 -0800 Subject: [PATCH] chore: update gapic-generator-java to 0.0.20 (#300) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/96c62e92-13ae-4f3c-9727-c854ec8b7488/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 357800868 Source-Link: https://github.com/googleapis/googleapis/commit/e8bc4471a88ac5f60defe3ed436f517174e59ba0 PiperOrigin-RevId: 356341083 Source-Link: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb PiperOrigin-RevId: 355768415 Source-Link: https://github.com/googleapis/googleapis/commit/bc89fd90b0dc87b387d83a56b27789f807d9da11 PiperOrigin-RevId: 355768365 Source-Link: https://github.com/googleapis/googleapis/commit/bb17e41ec1e9f1197520560bc13cc5da24e04e6f build: change package name to correct name docs: generate sample code in the Java microgenerator --- .../v1/LookupServiceClient.java | 44 + .../v1/RegistrationServiceClient.java | 882 ++++++++++++++++++ .../servicedirectory/v1/package-info.java | 23 + .../v1/stub/GrpcLookupServiceStub.java | 1 + .../v1/stub/GrpcRegistrationServiceStub.java | 21 + .../v1beta1/LookupServiceClient.java | 44 + .../v1beta1/RegistrationServiceClient.java | 876 +++++++++++++++++ .../v1beta1/package-info.java | 23 + .../v1beta1/stub/GrpcLookupServiceStub.java | 1 + .../stub/GrpcRegistrationServiceStub.java | 21 + .../v1/MockLookupServiceImpl.java | 8 +- .../v1/MockRegistrationServiceImpl.java | 144 ++- .../v1beta1/MockLookupServiceImpl.java | 8 +- .../v1beta1/MockRegistrationServiceImpl.java | 144 ++- synth.metadata | 8 +- 15 files changed, 2206 insertions(+), 42 deletions(-) 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 index 752f3269..9f6d5ecc 100644 --- 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 @@ -32,6 +32,19 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+ *   ResolveServiceRequest request =
+ *       ResolveServiceRequest.newBuilder()
+ *           .setName(
+ *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+ *           .setMaxEndpoints(2074789987)
+ *           .setEndpointFilter("endpointFilter-1834249875")
+ *           .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(). * @@ -136,6 +149,21 @@ public LookupServiceStub getStub() { * Returns a [service][google.cloud.servicedirectory.v1.Service] and its associated endpoints. * Resolving a service is not considered an active developer method. * + *

Sample code: + * + *

{@code
+   * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+   *   ResolveServiceRequest request =
+   *       ResolveServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setMaxEndpoints(2074789987)
+   *           .setEndpointFilter("endpointFilter-1834249875")
+   *           .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 */ @@ -149,6 +177,22 @@ public final ResolveServiceResponse resolveService(ResolveServiceRequest request * Resolving a service is not considered an active developer method. * *

Sample code: + * + *

{@code
+   * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+   *   ResolveServiceRequest request =
+   *       ResolveServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setMaxEndpoints(2074789987)
+   *           .setEndpointFilter("endpointFilter-1834249875")
+   *           .build();
+   *   ApiFuture future =
+   *       lookupServiceClient.resolveServiceCallable().futureCall(request);
+   *   // Do something.
+   *   ResolveServiceResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable resolveServiceCallable() { 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 index 1c1e095f..b7e3f0c3 100644 --- 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 @@ -59,6 +59,16 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Namespace namespace = Namespace.newBuilder().build();
+ *   String namespaceId = "namespaceId790852566";
+ *   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(). @@ -165,6 +175,18 @@ public RegistrationServiceStub getStub() { /** * Creates a namespace, and returns the new Namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   String namespaceId = "namespaceId790852566";
+   *   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. @@ -191,6 +213,18 @@ public final Namespace createNamespace( /** * Creates a namespace, and returns the new Namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   String namespaceId = "namespaceId790852566";
+   *   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. @@ -216,6 +250,20 @@ public final Namespace createNamespace(String parent, Namespace namespace, Strin /** * Creates a namespace, and returns the new Namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateNamespaceRequest request =
+   *       CreateNamespaceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setNamespaceId("namespaceId790852566")
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .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 */ @@ -228,6 +276,21 @@ public final Namespace createNamespace(CreateNamespaceRequest request) { * Creates a namespace, and returns the new Namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateNamespaceRequest request =
+   *       CreateNamespaceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setNamespaceId("namespaceId790852566")
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.createNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   Namespace response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createNamespaceCallable() { return stub.createNamespaceCallable(); @@ -237,6 +300,17 @@ public final UnaryCallable createNamespaceCal /** * Lists all namespaces. * + *

Sample code: + * + *

{@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 @@ -253,6 +327,17 @@ public final ListNamespacesPagedResponse listNamespaces(LocationName parent) { /** * Lists all namespaces. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   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 @@ -266,6 +351,24 @@ public final ListNamespacesPagedResponse listNamespaces(String parent) { /** * Lists all namespaces. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListNamespacesRequest request =
+   *       ListNamespacesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .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 */ @@ -278,6 +381,25 @@ public final ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest re * Lists all namespaces. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListNamespacesRequest request =
+   *       ListNamespacesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.listNamespacesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Namespace element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listNamespacesPagedCallable() { @@ -289,6 +411,24 @@ public final ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest re * Lists all namespaces. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   while (true) {
+   *     ListNamespacesResponse response =
+   *         registrationServiceClient.listNamespacesCallable().call(request);
+   *     for (Namespace element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listNamespacesCallable() { @@ -299,6 +439,15 @@ public final ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest re /** * Gets a namespace. * + *

Sample code: + * + *

{@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 */ @@ -312,6 +461,15 @@ public final Namespace getNamespace(NamespaceName name) { /** * Gets a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   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 */ @@ -324,6 +482,18 @@ public final Namespace getNamespace(String name) { /** * Gets a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetNamespaceRequest request =
+   *       GetNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").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 */ @@ -336,6 +506,19 @@ public final Namespace getNamespace(GetNamespaceRequest request) { * Gets a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetNamespaceRequest request =
+   *       GetNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   Namespace response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getNamespaceCallable() { return stub.getNamespaceCallable(); @@ -345,6 +528,16 @@ public final UnaryCallable getNamespaceCallable( /** * Updates a namespace. * + *

Sample code: + * + *

{@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 @@ -362,6 +555,19 @@ public final Namespace updateNamespace(Namespace namespace, FieldMask updateMask /** * Updates a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateNamespaceRequest request =
+   *       UpdateNamespaceRequest.newBuilder()
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .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 */ @@ -374,6 +580,20 @@ public final Namespace updateNamespace(UpdateNamespaceRequest request) { * Updates a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateNamespaceRequest request =
+   *       UpdateNamespaceRequest.newBuilder()
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.updateNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   Namespace response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateNamespaceCallable() { return stub.updateNamespaceCallable(); @@ -383,6 +603,15 @@ public final UnaryCallable updateNamespaceCal /** * Deletes a namespace. This also deletes all services and endpoints in the namespace. * + *

Sample code: + * + *

{@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 */ @@ -396,6 +625,15 @@ public final void deleteNamespace(NamespaceName name) { /** * Deletes a namespace. This also deletes all services and endpoints in the namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   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 */ @@ -408,6 +646,18 @@ public final void deleteNamespace(String name) { /** * Deletes a namespace. This also deletes all services and endpoints in the namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteNamespaceRequest request =
+   *       DeleteNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").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 */ @@ -420,6 +670,19 @@ public final void deleteNamespace(DeleteNamespaceRequest request) { * Deletes a namespace. This also deletes all services and endpoints in the namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteNamespaceRequest request =
+   *       DeleteNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.deleteNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteNamespaceCallable() { return stub.deleteNamespaceCallable(); @@ -429,6 +692,17 @@ public final UnaryCallable deleteNamespaceCallabl /** * Creates a service, and returns the new Service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   Service service = Service.newBuilder().build();
+   *   String serviceId = "serviceId-194185552";
+   *   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 @@ -453,6 +727,17 @@ public final Service createService(NamespaceName parent, Service service, String /** * Creates a service, and returns the new Service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   Service service = Service.newBuilder().build();
+   *   String serviceId = "serviceId-194185552";
+   *   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 @@ -477,6 +762,20 @@ public final Service createService(String parent, Service service, String servic /** * Creates a service, and returns the new Service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateServiceRequest request =
+   *       CreateServiceRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setServiceId("serviceId-194185552")
+   *           .setService(Service.newBuilder().build())
+   *           .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 */ @@ -489,6 +788,21 @@ public final Service createService(CreateServiceRequest request) { * Creates a service, and returns the new Service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateServiceRequest request =
+   *       CreateServiceRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setServiceId("serviceId-194185552")
+   *           .setService(Service.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.createServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createServiceCallable() { return stub.createServiceCallable(); @@ -498,6 +812,17 @@ public final UnaryCallable createServiceCallable( /** * Lists all services belonging to a namespace. * + *

Sample code: + * + *

{@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 */ @@ -513,6 +838,17 @@ public final ListServicesPagedResponse listServices(NamespaceName parent) { /** * Lists all services belonging to a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   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 */ @@ -525,6 +861,24 @@ public final ListServicesPagedResponse listServices(String parent) { /** * Lists all services belonging to a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListServicesRequest request =
+   *       ListServicesRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .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 */ @@ -537,6 +891,25 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request) * Lists all services belonging to a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListServicesRequest request =
+   *       ListServicesRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.listServicesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Service element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listServicesPagedCallable() { @@ -548,6 +921,24 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request) * Lists all services belonging to a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   while (true) {
+   *     ListServicesResponse response =
+   *         registrationServiceClient.listServicesCallable().call(request);
+   *     for (Service element : response.getResponsesList()) {
+   *       // 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(); @@ -557,6 +948,15 @@ public final UnaryCallable listServic /** * Gets a service. * + *

Sample code: + * + *

{@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 */ @@ -570,6 +970,16 @@ public final Service getService(ServiceName name) { /** * Gets a service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   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 */ @@ -582,6 +992,19 @@ public final Service getService(String name) { /** * Gets a service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetServiceRequest request =
+   *       GetServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").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 */ @@ -594,6 +1017,20 @@ public final Service getService(GetServiceRequest request) { * Gets a service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetServiceRequest request =
+   *       GetServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getServiceCallable() { return stub.getServiceCallable(); @@ -603,6 +1040,16 @@ public final UnaryCallable getServiceCallable() { /** * Updates a service. * + *

Sample code: + * + *

{@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 @@ -617,6 +1064,19 @@ public final Service updateService(Service service, FieldMask updateMask) { /** * Updates a service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateServiceRequest request =
+   *       UpdateServiceRequest.newBuilder()
+   *           .setService(Service.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .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 */ @@ -629,6 +1089,20 @@ public final Service updateService(UpdateServiceRequest request) { * Updates a service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateServiceRequest request =
+   *       UpdateServiceRequest.newBuilder()
+   *           .setService(Service.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.updateServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateServiceCallable() { return stub.updateServiceCallable(); @@ -638,6 +1112,15 @@ public final UnaryCallable updateServiceCallable( /** * Deletes a service. This also deletes all endpoints associated with the service. * + *

Sample code: + * + *

{@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 */ @@ -651,6 +1134,16 @@ public final void deleteService(ServiceName name) { /** * Deletes a service. This also deletes all endpoints associated with the service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   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 */ @@ -663,6 +1156,19 @@ public final void deleteService(String name) { /** * Deletes a service. This also deletes all endpoints associated with the service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteServiceRequest request =
+   *       DeleteServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").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 */ @@ -675,6 +1181,20 @@ public final void deleteService(DeleteServiceRequest request) { * Deletes a service. This also deletes all endpoints associated with the service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteServiceRequest request =
+   *       DeleteServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.deleteServiceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteServiceCallable() { return stub.deleteServiceCallable(); @@ -684,6 +1204,17 @@ public final UnaryCallable deleteServiceCallable() /** * Creates a endpoint, and returns the new Endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   String endpointId = "endpointId-1837754992";
+   *   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 @@ -708,6 +1239,18 @@ public final Endpoint createEndpoint(ServiceName parent, Endpoint endpoint, Stri /** * Creates a endpoint, and returns the new Endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   String endpointId = "endpointId-1837754992";
+   *   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 @@ -732,6 +1275,21 @@ public final Endpoint createEndpoint(String parent, Endpoint endpoint, String en /** * Creates a endpoint, and returns the new Endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateEndpointRequest request =
+   *       CreateEndpointRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setEndpointId("endpointId-1837754992")
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .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 */ @@ -744,6 +1302,22 @@ public final Endpoint createEndpoint(CreateEndpointRequest request) { * Creates a endpoint, and returns the new Endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateEndpointRequest request =
+   *       CreateEndpointRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setEndpointId("endpointId-1837754992")
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.createEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createEndpointCallable() { return stub.createEndpointCallable(); @@ -753,6 +1327,17 @@ public final UnaryCallable createEndpointCallab /** * Lists all endpoints. * + *

Sample code: + * + *

{@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 */ @@ -768,6 +1353,18 @@ public final ListEndpointsPagedResponse listEndpoints(ServiceName parent) { /** * Lists all endpoints. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   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 */ @@ -780,6 +1377,25 @@ public final ListEndpointsPagedResponse listEndpoints(String parent) { /** * Lists all endpoints. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListEndpointsRequest request =
+   *       ListEndpointsRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .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 */ @@ -792,6 +1408,26 @@ public final ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest reque * Lists all endpoints. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListEndpointsRequest request =
+   *       ListEndpointsRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.listEndpointsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Endpoint element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listEndpointsPagedCallable() { @@ -803,6 +1439,24 @@ public final ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest reque * Lists all endpoints. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   while (true) {
+   *     ListEndpointsResponse response =
+   *         registrationServiceClient.listEndpointsCallable().call(request);
+   *     for (Endpoint element : response.getResponsesList()) {
+   *       // 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(); @@ -812,6 +1466,16 @@ public final UnaryCallable listEndp /** * Gets a endpoint. * + *

Sample code: + * + *

{@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 */ @@ -825,6 +1489,17 @@ public final Endpoint getEndpoint(EndpointName name) { /** * Gets a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *           .toString();
+   *   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 */ @@ -837,6 +1512,21 @@ public final Endpoint getEndpoint(String name) { /** * Gets a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetEndpointRequest request =
+   *       GetEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .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 */ @@ -849,6 +1539,22 @@ public final Endpoint getEndpoint(GetEndpointRequest request) { * Gets a endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetEndpointRequest request =
+   *       GetEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getEndpointCallable() { return stub.getEndpointCallable(); @@ -858,6 +1564,16 @@ public final UnaryCallable getEndpointCallable() { /** * Updates a endpoint. * + *

Sample code: + * + *

{@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 @@ -872,6 +1588,19 @@ public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask) { /** * Updates a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateEndpointRequest request =
+   *       UpdateEndpointRequest.newBuilder()
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .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 */ @@ -884,6 +1613,20 @@ public final Endpoint updateEndpoint(UpdateEndpointRequest request) { * Updates a endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateEndpointRequest request =
+   *       UpdateEndpointRequest.newBuilder()
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.updateEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateEndpointCallable() { return stub.updateEndpointCallable(); @@ -893,6 +1636,16 @@ public final UnaryCallable updateEndpointCallab /** * Deletes a endpoint. * + *

Sample code: + * + *

{@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 */ @@ -906,6 +1659,17 @@ public final void deleteEndpoint(EndpointName name) { /** * Deletes a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *           .toString();
+   *   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 */ @@ -918,6 +1682,21 @@ public final void deleteEndpoint(String name) { /** * Deletes a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteEndpointRequest request =
+   *       DeleteEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .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 */ @@ -930,6 +1709,22 @@ public final void deleteEndpoint(DeleteEndpointRequest request) { * Deletes a endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteEndpointRequest request =
+   *       DeleteEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.deleteEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteEndpointCallable() { return stub.deleteEndpointCallable(); @@ -939,6 +1734,20 @@ public final UnaryCallable deleteEndpointCallable( /** * Gets the IAM Policy for a resource (namespace or service only). * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .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 */ @@ -951,6 +1760,21 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * Gets the IAM Policy for a resource (namespace or service only). * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getIamPolicyCallable() { return stub.getIamPolicyCallable(); @@ -960,6 +1784,20 @@ public final UnaryCallable getIamPolicyCallable() { /** * Sets the IAM Policy for a resource (namespace or service only). * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .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 */ @@ -972,6 +1810,21 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * Sets the IAM Policy for a resource (namespace or service only). * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable setIamPolicyCallable() { return stub.setIamPolicyCallable(); @@ -981,6 +1834,20 @@ public final UnaryCallable setIamPolicyCallable() { /** * Tests IAM permissions for a resource (namespace or service only). * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .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 */ @@ -993,6 +1860,21 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * Tests IAM permissions for a resource (namespace or service only). * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable testIamPermissionsCallable() { 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 index 2336e026..f2a06c86 100644 --- 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 @@ -23,6 +23,19 @@ * *

Sample for LookupServiceClient: * + *

{@code
+ * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+ *   ResolveServiceRequest request =
+ *       ResolveServiceRequest.newBuilder()
+ *           .setName(
+ *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+ *           .setMaxEndpoints(2074789987)
+ *           .setEndpointFilter("endpointFilter-1834249875")
+ *           .build();
+ *   ResolveServiceResponse response = lookupServiceClient.resolveService(request);
+ * }
+ * }
+ * *

======================= RegistrationServiceClient ======================= * *

Service Description: Service Directory API for registering services. It defines the following @@ -39,6 +52,16 @@ * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. * *

Sample for RegistrationServiceClient: + * + *

{@code
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Namespace namespace = Namespace.newBuilder().build();
+ *   String namespaceId = "namespaceId790852566";
+ *   Namespace response =
+ *       registrationServiceClient.createNamespace(parent, namespace, namespaceId);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.servicedirectory.v1; 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 index 9f2e7c03..1c54778b 100644 --- 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 @@ -124,6 +124,7 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable resolveServiceCallable() { return resolveServiceCallable; } 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 index 45fcc2a2..670ed7f8 100644 --- 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 @@ -637,88 +637,109 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createNamespaceCallable() { return createNamespaceCallable; } + @Override public UnaryCallable listNamespacesCallable() { return listNamespacesCallable; } + @Override public UnaryCallable listNamespacesPagedCallable() { return listNamespacesPagedCallable; } + @Override public UnaryCallable getNamespaceCallable() { return getNamespaceCallable; } + @Override public UnaryCallable updateNamespaceCallable() { return updateNamespaceCallable; } + @Override public UnaryCallable deleteNamespaceCallable() { return deleteNamespaceCallable; } + @Override public UnaryCallable createServiceCallable() { return createServiceCallable; } + @Override public UnaryCallable listServicesCallable() { return listServicesCallable; } + @Override public UnaryCallable listServicesPagedCallable() { return listServicesPagedCallable; } + @Override public UnaryCallable getServiceCallable() { return getServiceCallable; } + @Override public UnaryCallable updateServiceCallable() { return updateServiceCallable; } + @Override public UnaryCallable deleteServiceCallable() { return deleteServiceCallable; } + @Override public UnaryCallable createEndpointCallable() { return createEndpointCallable; } + @Override public UnaryCallable listEndpointsCallable() { return listEndpointsCallable; } + @Override public UnaryCallable listEndpointsPagedCallable() { return listEndpointsPagedCallable; } + @Override public UnaryCallable getEndpointCallable() { return getEndpointCallable; } + @Override public UnaryCallable updateEndpointCallable() { return updateEndpointCallable; } + @Override public UnaryCallable deleteEndpointCallable() { return deleteEndpointCallable; } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } + @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } + @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java index 1a6f1196..aa382f4f 100644 --- a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/LookupServiceClient.java @@ -32,6 +32,19 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+ *   ResolveServiceRequest request =
+ *       ResolveServiceRequest.newBuilder()
+ *           .setName(
+ *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+ *           .setMaxEndpoints(2074789987)
+ *           .setEndpointFilter("endpointFilter-1834249875")
+ *           .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(). * @@ -137,6 +150,21 @@ public LookupServiceStub getStub() { * Returns a [service][google.cloud.servicedirectory.v1beta1.Service] and its associated * endpoints. Resolving a service is not considered an active developer method. * + *

Sample code: + * + *

{@code
+   * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+   *   ResolveServiceRequest request =
+   *       ResolveServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setMaxEndpoints(2074789987)
+   *           .setEndpointFilter("endpointFilter-1834249875")
+   *           .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 */ @@ -150,6 +178,22 @@ public final ResolveServiceResponse resolveService(ResolveServiceRequest request * endpoints. Resolving a service is not considered an active developer method. * *

Sample code: + * + *

{@code
+   * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+   *   ResolveServiceRequest request =
+   *       ResolveServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setMaxEndpoints(2074789987)
+   *           .setEndpointFilter("endpointFilter-1834249875")
+   *           .build();
+   *   ApiFuture future =
+   *       lookupServiceClient.resolveServiceCallable().futureCall(request);
+   *   // Do something.
+   *   ResolveServiceResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable resolveServiceCallable() { diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java index c0eb4dbb..f488c21e 100644 --- a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/RegistrationServiceClient.java @@ -59,6 +59,16 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Namespace namespace = Namespace.newBuilder().build();
+ *   String namespaceId = "namespaceId790852566";
+ *   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(). @@ -166,6 +176,18 @@ public RegistrationServiceStub getStub() { /** * Creates a namespace, and returns the new Namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   String namespaceId = "namespaceId790852566";
+   *   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. @@ -192,6 +214,18 @@ public final Namespace createNamespace( /** * Creates a namespace, and returns the new Namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Namespace namespace = Namespace.newBuilder().build();
+   *   String namespaceId = "namespaceId790852566";
+   *   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. @@ -217,6 +251,20 @@ public final Namespace createNamespace(String parent, Namespace namespace, Strin /** * Creates a namespace, and returns the new Namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateNamespaceRequest request =
+   *       CreateNamespaceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setNamespaceId("namespaceId790852566")
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .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 */ @@ -229,6 +277,21 @@ public final Namespace createNamespace(CreateNamespaceRequest request) { * Creates a namespace, and returns the new Namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateNamespaceRequest request =
+   *       CreateNamespaceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setNamespaceId("namespaceId790852566")
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.createNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   Namespace response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createNamespaceCallable() { return stub.createNamespaceCallable(); @@ -238,6 +301,17 @@ public final UnaryCallable createNamespaceCal /** * Lists all namespaces. * + *

Sample code: + * + *

{@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 @@ -254,6 +328,17 @@ public final ListNamespacesPagedResponse listNamespaces(LocationName parent) { /** * Lists all namespaces. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   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 @@ -267,6 +352,24 @@ public final ListNamespacesPagedResponse listNamespaces(String parent) { /** * Lists all namespaces. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListNamespacesRequest request =
+   *       ListNamespacesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .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 */ @@ -279,6 +382,25 @@ public final ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest re * Lists all namespaces. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListNamespacesRequest request =
+   *       ListNamespacesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.listNamespacesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Namespace element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listNamespacesPagedCallable() { @@ -290,6 +412,24 @@ public final ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest re * Lists all namespaces. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   while (true) {
+   *     ListNamespacesResponse response =
+   *         registrationServiceClient.listNamespacesCallable().call(request);
+   *     for (Namespace element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listNamespacesCallable() { @@ -300,6 +440,15 @@ public final ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest re /** * Gets a namespace. * + *

Sample code: + * + *

{@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 */ @@ -313,6 +462,15 @@ public final Namespace getNamespace(NamespaceName name) { /** * Gets a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   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 */ @@ -325,6 +483,18 @@ public final Namespace getNamespace(String name) { /** * Gets a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetNamespaceRequest request =
+   *       GetNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").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 */ @@ -337,6 +507,19 @@ public final Namespace getNamespace(GetNamespaceRequest request) { * Gets a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetNamespaceRequest request =
+   *       GetNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   Namespace response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getNamespaceCallable() { return stub.getNamespaceCallable(); @@ -346,6 +529,16 @@ public final UnaryCallable getNamespaceCallable( /** * Updates a namespace. * + *

Sample code: + * + *

{@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 @@ -363,6 +556,19 @@ public final Namespace updateNamespace(Namespace namespace, FieldMask updateMask /** * Updates a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateNamespaceRequest request =
+   *       UpdateNamespaceRequest.newBuilder()
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .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 */ @@ -375,6 +581,20 @@ public final Namespace updateNamespace(UpdateNamespaceRequest request) { * Updates a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateNamespaceRequest request =
+   *       UpdateNamespaceRequest.newBuilder()
+   *           .setNamespace(Namespace.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.updateNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   Namespace response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateNamespaceCallable() { return stub.updateNamespaceCallable(); @@ -384,6 +604,15 @@ public final UnaryCallable updateNamespaceCal /** * Deletes a namespace. This also deletes all services and endpoints in the namespace. * + *

Sample code: + * + *

{@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 */ @@ -397,6 +626,15 @@ public final void deleteNamespace(NamespaceName name) { /** * Deletes a namespace. This also deletes all services and endpoints in the namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   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 */ @@ -409,6 +647,18 @@ public final void deleteNamespace(String name) { /** * Deletes a namespace. This also deletes all services and endpoints in the namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteNamespaceRequest request =
+   *       DeleteNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").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 */ @@ -421,6 +671,19 @@ public final void deleteNamespace(DeleteNamespaceRequest request) { * Deletes a namespace. This also deletes all services and endpoints in the namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteNamespaceRequest request =
+   *       DeleteNamespaceRequest.newBuilder()
+   *           .setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.deleteNamespaceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteNamespaceCallable() { return stub.deleteNamespaceCallable(); @@ -430,6 +693,17 @@ public final UnaryCallable deleteNamespaceCallabl /** * Creates a service, and returns the new Service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
+   *   Service service = Service.newBuilder().build();
+   *   String serviceId = "serviceId-194185552";
+   *   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 @@ -454,6 +728,17 @@ public final Service createService(NamespaceName parent, Service service, String /** * Creates a service, and returns the new Service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   Service service = Service.newBuilder().build();
+   *   String serviceId = "serviceId-194185552";
+   *   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 @@ -478,6 +763,20 @@ public final Service createService(String parent, Service service, String servic /** * Creates a service, and returns the new Service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateServiceRequest request =
+   *       CreateServiceRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setServiceId("serviceId-194185552")
+   *           .setService(Service.newBuilder().build())
+   *           .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 */ @@ -490,6 +789,21 @@ public final Service createService(CreateServiceRequest request) { * Creates a service, and returns the new Service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateServiceRequest request =
+   *       CreateServiceRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setServiceId("serviceId-194185552")
+   *           .setService(Service.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.createServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createServiceCallable() { return stub.createServiceCallable(); @@ -499,6 +813,17 @@ public final UnaryCallable createServiceCallable( /** * Lists all services belonging to a namespace. * + *

Sample code: + * + *

{@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 */ @@ -514,6 +839,17 @@ public final ListServicesPagedResponse listServices(NamespaceName parent) { /** * Lists all services belonging to a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
+   *   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 */ @@ -526,6 +862,24 @@ public final ListServicesPagedResponse listServices(String parent) { /** * Lists all services belonging to a namespace. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListServicesRequest request =
+   *       ListServicesRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .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 */ @@ -538,6 +892,25 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request) * Lists all services belonging to a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListServicesRequest request =
+   *       ListServicesRequest.newBuilder()
+   *           .setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.listServicesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Service element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listServicesPagedCallable() { @@ -549,6 +922,24 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request) * Lists all services belonging to a namespace. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   while (true) {
+   *     ListServicesResponse response =
+   *         registrationServiceClient.listServicesCallable().call(request);
+   *     for (Service element : response.getResponsesList()) {
+   *       // 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(); @@ -558,6 +949,15 @@ public final UnaryCallable listServic /** * Gets a service. * + *

Sample code: + * + *

{@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 */ @@ -571,6 +971,16 @@ public final Service getService(ServiceName name) { /** * Gets a service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   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 */ @@ -583,6 +993,19 @@ public final Service getService(String name) { /** * Gets a service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetServiceRequest request =
+   *       GetServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").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 */ @@ -595,6 +1018,20 @@ public final Service getService(GetServiceRequest request) { * Gets a service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetServiceRequest request =
+   *       GetServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getServiceCallable() { return stub.getServiceCallable(); @@ -604,6 +1041,16 @@ public final UnaryCallable getServiceCallable() { /** * Updates a service. * + *

Sample code: + * + *

{@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 @@ -618,6 +1065,19 @@ public final Service updateService(Service service, FieldMask updateMask) { /** * Updates a service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateServiceRequest request =
+   *       UpdateServiceRequest.newBuilder()
+   *           .setService(Service.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .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 */ @@ -630,6 +1090,20 @@ public final Service updateService(UpdateServiceRequest request) { * Updates a service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateServiceRequest request =
+   *       UpdateServiceRequest.newBuilder()
+   *           .setService(Service.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.updateServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateServiceCallable() { return stub.updateServiceCallable(); @@ -639,6 +1113,15 @@ public final UnaryCallable updateServiceCallable( /** * Deletes a service. This also deletes all endpoints associated with the service. * + *

Sample code: + * + *

{@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 */ @@ -652,6 +1135,16 @@ public final void deleteService(ServiceName name) { /** * Deletes a service. This also deletes all endpoints associated with the service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   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 */ @@ -664,6 +1157,19 @@ public final void deleteService(String name) { /** * Deletes a service. This also deletes all endpoints associated with the service. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteServiceRequest request =
+   *       DeleteServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").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 */ @@ -676,6 +1182,20 @@ public final void deleteService(DeleteServiceRequest request) { * Deletes a service. This also deletes all endpoints associated with the service. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteServiceRequest request =
+   *       DeleteServiceRequest.newBuilder()
+   *           .setName(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.deleteServiceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteServiceCallable() { return stub.deleteServiceCallable(); @@ -685,6 +1205,17 @@ public final UnaryCallable deleteServiceCallable() /** * Creates a endpoint, and returns the new Endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   String endpointId = "endpointId-1837754992";
+   *   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 @@ -709,6 +1240,18 @@ public final Endpoint createEndpoint(ServiceName parent, Endpoint endpoint, Stri /** * Creates a endpoint, and returns the new Endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   Endpoint endpoint = Endpoint.newBuilder().build();
+   *   String endpointId = "endpointId-1837754992";
+   *   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 @@ -733,6 +1276,21 @@ public final Endpoint createEndpoint(String parent, Endpoint endpoint, String en /** * Creates a endpoint, and returns the new Endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateEndpointRequest request =
+   *       CreateEndpointRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setEndpointId("endpointId-1837754992")
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .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 */ @@ -745,6 +1303,22 @@ public final Endpoint createEndpoint(CreateEndpointRequest request) { * Creates a endpoint, and returns the new Endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   CreateEndpointRequest request =
+   *       CreateEndpointRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setEndpointId("endpointId-1837754992")
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.createEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createEndpointCallable() { return stub.createEndpointCallable(); @@ -754,6 +1328,17 @@ public final UnaryCallable createEndpointCallab /** * Lists all endpoints. * + *

Sample code: + * + *

{@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 */ @@ -769,6 +1354,18 @@ public final ListEndpointsPagedResponse listEndpoints(ServiceName parent) { /** * Lists all endpoints. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String parent =
+   *       ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
+   *   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 */ @@ -781,6 +1378,25 @@ public final ListEndpointsPagedResponse listEndpoints(String parent) { /** * Lists all endpoints. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListEndpointsRequest request =
+   *       ListEndpointsRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .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 */ @@ -793,6 +1409,26 @@ public final ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest reque * Lists all endpoints. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   ListEndpointsRequest request =
+   *       ListEndpointsRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.listEndpointsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Endpoint element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listEndpointsPagedCallable() { @@ -804,6 +1440,24 @@ public final ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest reque * Lists all endpoints. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   while (true) {
+   *     ListEndpointsResponse response =
+   *         registrationServiceClient.listEndpointsCallable().call(request);
+   *     for (Endpoint element : response.getResponsesList()) {
+   *       // 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(); @@ -813,6 +1467,16 @@ public final UnaryCallable listEndp /** * Gets a endpoint. * + *

Sample code: + * + *

{@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 */ @@ -826,6 +1490,17 @@ public final Endpoint getEndpoint(EndpointName name) { /** * Gets a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *           .toString();
+   *   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 */ @@ -838,6 +1513,21 @@ public final Endpoint getEndpoint(String name) { /** * Gets a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetEndpointRequest request =
+   *       GetEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .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 */ @@ -850,6 +1540,22 @@ public final Endpoint getEndpoint(GetEndpointRequest request) { * Gets a endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetEndpointRequest request =
+   *       GetEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getEndpointCallable() { return stub.getEndpointCallable(); @@ -859,6 +1565,16 @@ public final UnaryCallable getEndpointCallable() { /** * Updates a endpoint. * + *

Sample code: + * + *

{@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 @@ -873,6 +1589,19 @@ public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask) { /** * Updates a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateEndpointRequest request =
+   *       UpdateEndpointRequest.newBuilder()
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .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 */ @@ -885,6 +1614,20 @@ public final Endpoint updateEndpoint(UpdateEndpointRequest request) { * Updates a endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   UpdateEndpointRequest request =
+   *       UpdateEndpointRequest.newBuilder()
+   *           .setEndpoint(Endpoint.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.updateEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   Endpoint response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateEndpointCallable() { return stub.updateEndpointCallable(); @@ -894,6 +1637,16 @@ public final UnaryCallable updateEndpointCallab /** * Deletes a endpoint. * + *

Sample code: + * + *

{@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 */ @@ -907,6 +1660,17 @@ public final void deleteEndpoint(EndpointName name) { /** * Deletes a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   String name =
+   *       EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *           .toString();
+   *   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 */ @@ -919,6 +1683,21 @@ public final void deleteEndpoint(String name) { /** * Deletes a endpoint. * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteEndpointRequest request =
+   *       DeleteEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .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 */ @@ -931,6 +1710,22 @@ public final void deleteEndpoint(DeleteEndpointRequest request) { * Deletes a endpoint. * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   DeleteEndpointRequest request =
+   *       DeleteEndpointRequest.newBuilder()
+   *           .setName(
+   *               EndpointName.of(
+   *                       "[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.deleteEndpointCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteEndpointCallable() { return stub.deleteEndpointCallable(); @@ -940,6 +1735,19 @@ public final UnaryCallable deleteEndpointCallable( /** * Gets the IAM Policy for a resource (namespace or service only). * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .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 */ @@ -952,6 +1760,20 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * Gets the IAM Policy for a resource (namespace or service only). * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getIamPolicyCallable() { return stub.getIamPolicyCallable(); @@ -961,6 +1783,19 @@ public final UnaryCallable getIamPolicyCallable() { /** * Sets the IAM Policy for a resource (namespace or service only). * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .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 */ @@ -973,6 +1808,20 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * Sets the IAM Policy for a resource (namespace or service only). * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable setIamPolicyCallable() { return stub.setIamPolicyCallable(); @@ -982,6 +1831,19 @@ public final UnaryCallable setIamPolicyCallable() { /** * Tests IAM permissions for a resource (namespace or service only). * + *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .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 */ @@ -994,6 +1856,20 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * Tests IAM permissions for a resource (namespace or service only). * *

Sample code: + * + *

{@code
+   * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       registrationServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable testIamPermissionsCallable() { diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java index e2cd196a..941c1105 100644 --- a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/package-info.java @@ -23,6 +23,19 @@ * *

Sample for LookupServiceClient: * + *

{@code
+ * try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) {
+ *   ResolveServiceRequest request =
+ *       ResolveServiceRequest.newBuilder()
+ *           .setName(
+ *               ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
+ *           .setMaxEndpoints(2074789987)
+ *           .setEndpointFilter("endpointFilter-1834249875")
+ *           .build();
+ *   ResolveServiceResponse response = lookupServiceClient.resolveService(request);
+ * }
+ * }
+ * *

======================= RegistrationServiceClient ======================= * *

Service Description: Service Directory API for registering services. It defines the following @@ -39,6 +52,16 @@ * `projects/*/locations/*/namespaces/*/services/*/endpoints/*`. * *

Sample for RegistrationServiceClient: + * + *

{@code
+ * try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   Namespace namespace = Namespace.newBuilder().build();
+ *   String namespaceId = "namespaceId790852566";
+ *   Namespace response =
+ *       registrationServiceClient.createNamespace(parent, namespace, namespaceId);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.servicedirectory.v1beta1; diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java index d84f1f92..efce3a89 100644 --- a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcLookupServiceStub.java @@ -127,6 +127,7 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable resolveServiceCallable() { return resolveServiceCallable; } diff --git a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java index 49d20286..a1440b25 100644 --- a/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java +++ b/google-cloud-servicedirectory/src/main/java/com/google/cloud/servicedirectory/v1beta1/stub/GrpcRegistrationServiceStub.java @@ -643,88 +643,109 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createNamespaceCallable() { return createNamespaceCallable; } + @Override public UnaryCallable listNamespacesCallable() { return listNamespacesCallable; } + @Override public UnaryCallable listNamespacesPagedCallable() { return listNamespacesPagedCallable; } + @Override public UnaryCallable getNamespaceCallable() { return getNamespaceCallable; } + @Override public UnaryCallable updateNamespaceCallable() { return updateNamespaceCallable; } + @Override public UnaryCallable deleteNamespaceCallable() { return deleteNamespaceCallable; } + @Override public UnaryCallable createServiceCallable() { return createServiceCallable; } + @Override public UnaryCallable listServicesCallable() { return listServicesCallable; } + @Override public UnaryCallable listServicesPagedCallable() { return listServicesPagedCallable; } + @Override public UnaryCallable getServiceCallable() { return getServiceCallable; } + @Override public UnaryCallable updateServiceCallable() { return updateServiceCallable; } + @Override public UnaryCallable deleteServiceCallable() { return deleteServiceCallable; } + @Override public UnaryCallable createEndpointCallable() { return createEndpointCallable; } + @Override public UnaryCallable listEndpointsCallable() { return listEndpointsCallable; } + @Override public UnaryCallable listEndpointsPagedCallable() { return listEndpointsPagedCallable; } + @Override public UnaryCallable getEndpointCallable() { return getEndpointCallable; } + @Override public UnaryCallable updateEndpointCallable() { return updateEndpointCallable; } + @Override public UnaryCallable deleteEndpointCallable() { return deleteEndpointCallable; } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } + @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } + @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; 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 index ba4c82a5..95496f1b 100644 --- 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 @@ -69,7 +69,13 @@ public void resolveService( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResolveService, expected %s or %s", + response.getClass().getName(), + ResolveServiceResponse.class.getName(), + Exception.class.getName()))); } } } 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 index 5a81f3e1..0580ce5c 100644 --- 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 @@ -75,7 +75,13 @@ public void createNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateNamespace, expected %s or %s", + response.getClass().getName(), + Namespace.class.getName(), + Exception.class.getName()))); } } @@ -90,7 +96,13 @@ public void listNamespaces( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListNamespaces, expected %s or %s", + response.getClass().getName(), + ListNamespacesResponse.class.getName(), + Exception.class.getName()))); } } @@ -105,7 +117,13 @@ public void getNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetNamespace, expected %s or %s", + response.getClass().getName(), + Namespace.class.getName(), + Exception.class.getName()))); } } @@ -120,7 +138,13 @@ public void updateNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateNamespace, expected %s or %s", + response.getClass().getName(), + Namespace.class.getName(), + Exception.class.getName()))); } } @@ -135,7 +159,13 @@ public void deleteNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteNamespace, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -150,7 +180,13 @@ public void createService( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateService, expected %s or %s", + response.getClass().getName(), + Service.class.getName(), + Exception.class.getName()))); } } @@ -165,7 +201,13 @@ public void listServices( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListServices, expected %s or %s", + response.getClass().getName(), + ListServicesResponse.class.getName(), + Exception.class.getName()))); } } @@ -179,7 +221,13 @@ public void getService(GetServiceRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetService, expected %s or %s", + response.getClass().getName(), + Service.class.getName(), + Exception.class.getName()))); } } @@ -194,7 +242,13 @@ public void updateService( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateService, expected %s or %s", + response.getClass().getName(), + Service.class.getName(), + Exception.class.getName()))); } } @@ -208,7 +262,13 @@ public void deleteService(DeleteServiceRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteService, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -223,7 +283,13 @@ public void createEndpoint( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateEndpoint, expected %s or %s", + response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); } } @@ -238,7 +304,13 @@ public void listEndpoints( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEndpoints, expected %s or %s", + response.getClass().getName(), + ListEndpointsResponse.class.getName(), + Exception.class.getName()))); } } @@ -252,7 +324,13 @@ public void getEndpoint(GetEndpointRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEndpoint, expected %s or %s", + response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); } } @@ -267,7 +345,13 @@ public void updateEndpoint( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateEndpoint, expected %s or %s", + response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); } } @@ -282,7 +366,13 @@ public void deleteEndpoint( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteEndpoint, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -296,7 +386,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -310,7 +406,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -326,7 +428,13 @@ public void testIamPermissions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java index f4c5faec..452ebfe7 100644 --- a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockLookupServiceImpl.java @@ -69,7 +69,13 @@ public void resolveService( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResolveService, expected %s or %s", + response.getClass().getName(), + ResolveServiceResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java index 7a249b3c..183df3e5 100644 --- a/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java +++ b/google-cloud-servicedirectory/src/test/java/com/google/cloud/servicedirectory/v1beta1/MockRegistrationServiceImpl.java @@ -75,7 +75,13 @@ public void createNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateNamespace, expected %s or %s", + response.getClass().getName(), + Namespace.class.getName(), + Exception.class.getName()))); } } @@ -90,7 +96,13 @@ public void listNamespaces( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListNamespaces, expected %s or %s", + response.getClass().getName(), + ListNamespacesResponse.class.getName(), + Exception.class.getName()))); } } @@ -105,7 +117,13 @@ public void getNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetNamespace, expected %s or %s", + response.getClass().getName(), + Namespace.class.getName(), + Exception.class.getName()))); } } @@ -120,7 +138,13 @@ public void updateNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateNamespace, expected %s or %s", + response.getClass().getName(), + Namespace.class.getName(), + Exception.class.getName()))); } } @@ -135,7 +159,13 @@ public void deleteNamespace( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteNamespace, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -150,7 +180,13 @@ public void createService( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateService, expected %s or %s", + response.getClass().getName(), + Service.class.getName(), + Exception.class.getName()))); } } @@ -165,7 +201,13 @@ public void listServices( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListServices, expected %s or %s", + response.getClass().getName(), + ListServicesResponse.class.getName(), + Exception.class.getName()))); } } @@ -179,7 +221,13 @@ public void getService(GetServiceRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetService, expected %s or %s", + response.getClass().getName(), + Service.class.getName(), + Exception.class.getName()))); } } @@ -194,7 +242,13 @@ public void updateService( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateService, expected %s or %s", + response.getClass().getName(), + Service.class.getName(), + Exception.class.getName()))); } } @@ -208,7 +262,13 @@ public void deleteService(DeleteServiceRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteService, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -223,7 +283,13 @@ public void createEndpoint( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateEndpoint, expected %s or %s", + response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); } } @@ -238,7 +304,13 @@ public void listEndpoints( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEndpoints, expected %s or %s", + response.getClass().getName(), + ListEndpointsResponse.class.getName(), + Exception.class.getName()))); } } @@ -252,7 +324,13 @@ public void getEndpoint(GetEndpointRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEndpoint, expected %s or %s", + response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); } } @@ -267,7 +345,13 @@ public void updateEndpoint( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateEndpoint, expected %s or %s", + response.getClass().getName(), + Endpoint.class.getName(), + Exception.class.getName()))); } } @@ -282,7 +366,13 @@ public void deleteEndpoint( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteEndpoint, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -296,7 +386,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -310,7 +406,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -326,7 +428,13 @@ public void testIamPermissions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/synth.metadata b/synth.metadata index e2e90dc3..9b4b4f85 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f83715b48369c8d43548cc3cd84015e60be94cf2", - "internalRef": "352834280" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f83715b48369c8d43548cc3cd84015e60be94cf2", - "internalRef": "352834280" + "sha": "e8bc4471a88ac5f60defe3ed436f517174e59ba0", + "internalRef": "357800868" } }, {