@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@Override public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); }
@Override public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); }
/** * Lists all Redis instances owned by a project in either the specified location (region) or all * locations. * * <p>The location should have the following format: * * `projects/{project_id}/locations/{location_id}` * * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project * are queried, and the results are aggregated. * * <p>Sample code: * * <pre><code> * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); * for (Instance element : cloudRedisClient.listInstances(parent.toString()).iterateAll()) { * // doThingsWith(element); * } * } * </code></pre> * * @param parent Required. The resource name of the instance location using the form: * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListInstancesPagedResponse listInstances(String parent) { ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); return listInstances(request); }
ListInstancesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build();