getClusterCallable() {
+ return stub.getClusterCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the metadata and configuration of a specific Redis cluster.
+ *
+ * Completed longrunning.Operation will contain the new cluster object in the response field.
+ * The returned operation is automatically deleted after a few hours, so there is no need to call
+ * DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * Cluster cluster = Cluster.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Cluster response = cloudRedisClusterClient.updateClusterAsync(cluster, updateMask).get();
+ * }
+ * }
+ *
+ * @param cluster Required. Update description. Only fields specified in update_mask are updated.
+ * @param updateMask Required. Mask of fields to update. At least one path must be supplied in
+ * this field. The elements of the repeated paths field may only include these fields from
+ * [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+ * * `size_gb` * `replica_count`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture updateClusterAsync(
+ Cluster cluster, FieldMask updateMask) {
+ UpdateClusterRequest request =
+ UpdateClusterRequest.newBuilder().setCluster(cluster).setUpdateMask(updateMask).build();
+ return updateClusterAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the metadata and configuration of a specific Redis cluster.
+ *
+ * Completed longrunning.Operation will contain the new cluster object in the response field.
+ * The returned operation is automatically deleted after a few hours, so there is no need to call
+ * DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * UpdateClusterRequest request =
+ * UpdateClusterRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setCluster(Cluster.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Cluster response = cloudRedisClusterClient.updateClusterAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture updateClusterAsync(UpdateClusterRequest request) {
+ return updateClusterOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the metadata and configuration of a specific Redis cluster.
+ *
+ * Completed longrunning.Operation will contain the new cluster object in the response field.
+ * The returned operation is automatically deleted after a few hours, so there is no need to call
+ * DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * UpdateClusterRequest request =
+ * UpdateClusterRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setCluster(Cluster.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * cloudRedisClusterClient.updateClusterOperationCallable().futureCall(request);
+ * // Do something.
+ * Cluster response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ updateClusterOperationCallable() {
+ return stub.updateClusterOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the metadata and configuration of a specific Redis cluster.
+ *
+ * Completed longrunning.Operation will contain the new cluster object in the response field.
+ * The returned operation is automatically deleted after a few hours, so there is no need to call
+ * DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * UpdateClusterRequest request =
+ * UpdateClusterRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setCluster(Cluster.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * cloudRedisClusterClient.updateClusterCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable updateClusterCallable() {
+ return stub.updateClusterCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific Redis cluster. Cluster stops serving and data is deleted.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ * cloudRedisClusterClient.deleteClusterAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Redis cluster resource name using the form:
+ * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id`
+ * refers to a GCP region.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteClusterAsync(ClusterName name) {
+ DeleteClusterRequest request =
+ DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return deleteClusterAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific Redis cluster. Cluster stops serving and data is deleted.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+ * cloudRedisClusterClient.deleteClusterAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Redis cluster resource name using the form:
+ * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id`
+ * refers to a GCP region.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteClusterAsync(String name) {
+ DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build();
+ return deleteClusterAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific Redis cluster. Cluster stops serving and data is deleted.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * DeleteClusterRequest request =
+ * DeleteClusterRequest.newBuilder()
+ * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * cloudRedisClusterClient.deleteClusterAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture deleteClusterAsync(DeleteClusterRequest request) {
+ return deleteClusterOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific Redis cluster. Cluster stops serving and data is deleted.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * DeleteClusterRequest request =
+ * DeleteClusterRequest.newBuilder()
+ * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * cloudRedisClusterClient.deleteClusterOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ deleteClusterOperationCallable() {
+ return stub.deleteClusterOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specific Redis cluster. Cluster stops serving and data is deleted.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * DeleteClusterRequest request =
+ * DeleteClusterRequest.newBuilder()
+ * .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * cloudRedisClusterClient.deleteClusterCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable deleteClusterCallable() {
+ return stub.deleteClusterCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Redis cluster based on the specified properties. The creation is executed
+ * asynchronously and callers may check the returned operation to track its progress. Once the
+ * operation is completed the Redis cluster will be fully functional. The completed
+ * longrunning.Operation will contain the new cluster object in the response field.
+ *
+ * The returned operation is automatically deleted after a few hours, so there is no need to
+ * call DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Cluster cluster = Cluster.newBuilder().build();
+ * String clusterId = "clusterId561939637";
+ * Cluster response =
+ * cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the cluster location using the form:
+ * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.
+ * @param cluster Required. The cluster that is to be created.
+ * @param clusterId Required. The logical name of the Redis cluster in the customer project with
+ * the following restrictions:
+ *
+ * - Must contain only lowercase letters, numbers, and hyphens.
+ *
- Must start with a letter.
+ *
- Must be between 1-63 characters.
+ *
- Must end with a number or a letter.
+ *
- Must be unique within the customer project / location
+ *
+ *
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture createClusterAsync(
+ LocationName parent, Cluster cluster, String clusterId) {
+ CreateClusterRequest request =
+ CreateClusterRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setCluster(cluster)
+ .setClusterId(clusterId)
+ .build();
+ return createClusterAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Redis cluster based on the specified properties. The creation is executed
+ * asynchronously and callers may check the returned operation to track its progress. Once the
+ * operation is completed the Redis cluster will be fully functional. The completed
+ * longrunning.Operation will contain the new cluster object in the response field.
+ *
+ * The returned operation is automatically deleted after a few hours, so there is no need to
+ * call DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Cluster cluster = Cluster.newBuilder().build();
+ * String clusterId = "clusterId561939637";
+ * Cluster response =
+ * cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the cluster location using the form:
+ * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.
+ * @param cluster Required. The cluster that is to be created.
+ * @param clusterId Required. The logical name of the Redis cluster in the customer project with
+ * the following restrictions:
+ *
+ * - Must contain only lowercase letters, numbers, and hyphens.
+ *
- Must start with a letter.
+ *
- Must be between 1-63 characters.
+ *
- Must end with a number or a letter.
+ *
- Must be unique within the customer project / location
+ *
+ *
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture createClusterAsync(
+ String parent, Cluster cluster, String clusterId) {
+ CreateClusterRequest request =
+ CreateClusterRequest.newBuilder()
+ .setParent(parent)
+ .setCluster(cluster)
+ .setClusterId(clusterId)
+ .build();
+ return createClusterAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Redis cluster based on the specified properties. The creation is executed
+ * asynchronously and callers may check the returned operation to track its progress. Once the
+ * operation is completed the Redis cluster will be fully functional. The completed
+ * longrunning.Operation will contain the new cluster object in the response field.
+ *
+ * The returned operation is automatically deleted after a few hours, so there is no need to
+ * call DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * CreateClusterRequest request =
+ * CreateClusterRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setClusterId("clusterId561939637")
+ * .setCluster(Cluster.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Cluster response = cloudRedisClusterClient.createClusterAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture createClusterAsync(CreateClusterRequest request) {
+ return createClusterOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Redis cluster based on the specified properties. The creation is executed
+ * asynchronously and callers may check the returned operation to track its progress. Once the
+ * operation is completed the Redis cluster will be fully functional. The completed
+ * longrunning.Operation will contain the new cluster object in the response field.
+ *
+ * The returned operation is automatically deleted after a few hours, so there is no need to
+ * call DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * CreateClusterRequest request =
+ * CreateClusterRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setClusterId("clusterId561939637")
+ * .setCluster(Cluster.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * cloudRedisClusterClient.createClusterOperationCallable().futureCall(request);
+ * // Do something.
+ * Cluster response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ createClusterOperationCallable() {
+ return stub.createClusterOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a Redis cluster based on the specified properties. The creation is executed
+ * asynchronously and callers may check the returned operation to track its progress. Once the
+ * operation is completed the Redis cluster will be fully functional. The completed
+ * longrunning.Operation will contain the new cluster object in the response field.
+ *
+ * The returned operation is automatically deleted after a few hours, so there is no need to
+ * call DeleteOperation.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * CreateClusterRequest request =
+ * CreateClusterRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setClusterId("clusterId561939637")
+ * .setCluster(Cluster.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * cloudRedisClusterClient.createClusterCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable createClusterCallable() {
+ return stub.createClusterCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : cloudRedisClusterClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * cloudRedisClusterClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listLocationsPagedCallable() {
+ return stub.listLocationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * cloudRedisClusterClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listLocationsCallable() {
+ return stub.listLocationsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = cloudRedisClusterClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * cloudRedisClusterClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getLocationCallable() {
+ return stub.getLocationCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+
+ public static class ListClustersPagedResponse
+ extends AbstractPagedListResponse<
+ ListClustersRequest,
+ ListClustersResponse,
+ Cluster,
+ ListClustersPage,
+ ListClustersFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListClustersPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListClustersPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListClustersPagedResponse(ListClustersPage page) {
+ super(page, ListClustersFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListClustersPage
+ extends AbstractPage {
+
+ private ListClustersPage(
+ PageContext context,
+ ListClustersResponse response) {
+ super(context, response);
+ }
+
+ private static ListClustersPage createEmptyPage() {
+ return new ListClustersPage(null, null);
+ }
+
+ @Override
+ protected ListClustersPage createPage(
+ PageContext context,
+ ListClustersResponse response) {
+ return new ListClustersPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListClustersFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListClustersRequest,
+ ListClustersResponse,
+ Cluster,
+ ListClustersPage,
+ ListClustersFixedSizeCollection> {
+
+ private ListClustersFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListClustersFixedSizeCollection createEmptyCollection() {
+ return new ListClustersFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListClustersFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListClustersFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListLocationsPagedResponse
+ extends AbstractPagedListResponse<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListLocationsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListLocationsPagedResponse(ListLocationsPage page) {
+ super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListLocationsPage
+ extends AbstractPage<
+ ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
+
+ private ListLocationsPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ super(context, response);
+ }
+
+ private static ListLocationsPage createEmptyPage() {
+ return new ListLocationsPage(null, null);
+ }
+
+ @Override
+ protected ListLocationsPage createPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ return new ListLocationsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListLocationsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListLocationsFixedSizeCollection createEmptyCollection() {
+ return new ListLocationsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListLocationsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListLocationsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterSettings.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterSettings.java
new file mode 100644
index 000000000000..f59ba3032c24
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterSettings.java
@@ -0,0 +1,318 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.redis.cluster.v1;
+
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse;
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.cloud.redis.cluster.v1.stub.CloudRedisClusterStubSettings;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link CloudRedisClusterClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (redis.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of getCluster to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CloudRedisClusterSettings.Builder cloudRedisClusterSettingsBuilder =
+ * CloudRedisClusterSettings.newBuilder();
+ * cloudRedisClusterSettingsBuilder
+ * .getClusterSettings()
+ * .setRetrySettings(
+ * cloudRedisClusterSettingsBuilder
+ * .getClusterSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * CloudRedisClusterSettings cloudRedisClusterSettings = cloudRedisClusterSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class CloudRedisClusterSettings extends ClientSettings {
+
+ /** Returns the object with the settings used for calls to listClusters. */
+ public PagedCallSettings
+ listClustersSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).listClustersSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getCluster. */
+ public UnaryCallSettings getClusterSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).getClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateCluster. */
+ public UnaryCallSettings updateClusterSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).updateClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateCluster. */
+ public OperationCallSettings
+ updateClusterOperationSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).updateClusterOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteCluster. */
+ public UnaryCallSettings deleteClusterSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).deleteClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteCluster. */
+ public OperationCallSettings deleteClusterOperationSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).deleteClusterOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createCluster. */
+ public UnaryCallSettings createClusterSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).createClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createCluster. */
+ public OperationCallSettings
+ createClusterOperationSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).createClusterOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).listLocationsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return ((CloudRedisClusterStubSettings) getStubSettings()).getLocationSettings();
+ }
+
+ public static final CloudRedisClusterSettings create(CloudRedisClusterStubSettings stub)
+ throws IOException {
+ return new CloudRedisClusterSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return CloudRedisClusterStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return CloudRedisClusterStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return CloudRedisClusterStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return CloudRedisClusterStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return CloudRedisClusterStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return CloudRedisClusterStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return CloudRedisClusterStubSettings.defaultTransportChannelProvider();
+ }
+
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return CloudRedisClusterStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new REST builder for this class. */
+ @BetaApi
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected CloudRedisClusterSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for CloudRedisClusterSettings. */
+ public static class Builder extends ClientSettings.Builder {
+
+ protected Builder() throws IOException {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(CloudRedisClusterStubSettings.newBuilder(clientContext));
+ }
+
+ protected Builder(CloudRedisClusterSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(CloudRedisClusterStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ private static Builder createDefault() {
+ return new Builder(CloudRedisClusterStubSettings.newBuilder());
+ }
+
+ @BetaApi
+ private static Builder createHttpJsonDefault() {
+ return new Builder(CloudRedisClusterStubSettings.newHttpJsonBuilder());
+ }
+
+ public CloudRedisClusterStubSettings.Builder getStubSettingsBuilder() {
+ return ((CloudRedisClusterStubSettings.Builder) getStubSettings());
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to listClusters. */
+ public PagedCallSettings.Builder<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+ listClustersSettings() {
+ return getStubSettingsBuilder().listClustersSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getCluster. */
+ public UnaryCallSettings.Builder getClusterSettings() {
+ return getStubSettingsBuilder().getClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateCluster. */
+ public UnaryCallSettings.Builder updateClusterSettings() {
+ return getStubSettingsBuilder().updateClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateCluster. */
+ public OperationCallSettings.Builder
+ updateClusterOperationSettings() {
+ return getStubSettingsBuilder().updateClusterOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteCluster. */
+ public UnaryCallSettings.Builder deleteClusterSettings() {
+ return getStubSettingsBuilder().deleteClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteCluster. */
+ public OperationCallSettings.Builder
+ deleteClusterOperationSettings() {
+ return getStubSettingsBuilder().deleteClusterOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createCluster. */
+ public UnaryCallSettings.Builder createClusterSettings() {
+ return getStubSettingsBuilder().createClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createCluster. */
+ public OperationCallSettings.Builder
+ createClusterOperationSettings() {
+ return getStubSettingsBuilder().createClusterOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return getStubSettingsBuilder().listLocationsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getStubSettingsBuilder().getLocationSettings();
+ }
+
+ @Override
+ public CloudRedisClusterSettings build() throws IOException {
+ return new CloudRedisClusterSettings(this);
+ }
+ }
+}
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/gapic_metadata.json b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/gapic_metadata.json
new file mode 100644
index 000000000000..58d43a0ef8e8
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/gapic_metadata.json
@@ -0,0 +1,39 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
+ "language": "java",
+ "protoPackage": "google.cloud.redis.cluster.v1",
+ "libraryPackage": "com.google.cloud.redis.cluster.v1",
+ "services": {
+ "CloudRedisCluster": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "CloudRedisClusterClient",
+ "rpcs": {
+ "CreateCluster": {
+ "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"]
+ },
+ "DeleteCluster": {
+ "methods": ["deleteClusterAsync", "deleteClusterAsync", "deleteClusterAsync", "deleteClusterOperationCallable", "deleteClusterCallable"]
+ },
+ "GetCluster": {
+ "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"]
+ },
+ "GetLocation": {
+ "methods": ["getLocation", "getLocationCallable"]
+ },
+ "ListClusters": {
+ "methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"]
+ },
+ "ListLocations": {
+ "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
+ },
+ "UpdateCluster": {
+ "methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"]
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/package-info.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/package-info.java
new file mode 100644
index 000000000000..c4ce8ed398e8
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/package-info.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A client to Google Cloud Memorystore for Redis API
+ *
+ * The interfaces provided are listed below, along with usage samples.
+ *
+ *
======================= CloudRedisClusterClient =======================
+ *
+ *
Service Description: Configures and manages Cloud Memorystore for Redis clusters
+ *
+ *
Google Cloud Memorystore for Redis Cluster
+ *
+ *
The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and
+ * defines the following resource model for managing Redis clusters:
+ *
+ *
+ * - The service works with a collection of cloud projects, named: `/projects/*`
+ *
- Each project has a collection of available locations, named: `/locations/*`
+ *
- Each location has a collection of Redis clusters, named: `/clusters/*`
+ *
- As such, Redis clusters are resources of the form:
+ * `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+ *
+ *
+ * Note that location_id must be a GCP `region`; for example:
+ *
+ *
+ * - `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+ *
+ *
+ * We use API version selector for Flex APIs
+ *
+ *
+ * - The versioning strategy is release-based versioning
+ *
- Our backend CLH only deals with the superset version (called v1main)
+ *
- Existing backend for Redis Gen1 and MRR is not touched.
+ *
- More details in go/redis-flex-api-versioning
+ *
+ *
+ * Sample for CloudRedisClusterClient:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ * Cluster response = cloudRedisClusterClient.getCluster(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.redis.cluster.v1;
+
+import javax.annotation.Generated;
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStub.java
new file mode 100644
index 000000000000..1c4e842cb645
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStub.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.redis.cluster.v1.stub;
+
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse;
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.cloud.redis.cluster.v1.Cluster;
+import com.google.cloud.redis.cluster.v1.CreateClusterRequest;
+import com.google.cloud.redis.cluster.v1.DeleteClusterRequest;
+import com.google.cloud.redis.cluster.v1.GetClusterRequest;
+import com.google.cloud.redis.cluster.v1.ListClustersRequest;
+import com.google.cloud.redis.cluster.v1.ListClustersResponse;
+import com.google.cloud.redis.cluster.v1.UpdateClusterRequest;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the CloudRedisCluster service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class CloudRedisClusterStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public UnaryCallable listClustersPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listClustersPagedCallable()");
+ }
+
+ public UnaryCallable listClustersCallable() {
+ throw new UnsupportedOperationException("Not implemented: listClustersCallable()");
+ }
+
+ public UnaryCallable getClusterCallable() {
+ throw new UnsupportedOperationException("Not implemented: getClusterCallable()");
+ }
+
+ public OperationCallable updateClusterOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: updateClusterOperationCallable()");
+ }
+
+ public UnaryCallable updateClusterCallable() {
+ throw new UnsupportedOperationException("Not implemented: updateClusterCallable()");
+ }
+
+ public OperationCallable deleteClusterOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteClusterOperationCallable()");
+ }
+
+ public UnaryCallable deleteClusterCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteClusterCallable()");
+ }
+
+ public OperationCallable createClusterOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()");
+ }
+
+ public UnaryCallable createClusterCallable() {
+ throw new UnsupportedOperationException("Not implemented: createClusterCallable()");
+ }
+
+ public UnaryCallable
+ listLocationsPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
+ }
+
+ public UnaryCallable listLocationsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listLocationsCallable()");
+ }
+
+ public UnaryCallable getLocationCallable() {
+ throw new UnsupportedOperationException("Not implemented: getLocationCallable()");
+ }
+
+ @Override
+ public abstract void close();
+}
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStubSettings.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStubSettings.java
new file mode 100644
index 000000000000..1ba7d6c98ef1
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStubSettings.java
@@ -0,0 +1,736 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.redis.cluster.v1.stub;
+
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse;
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GaxProperties;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.GaxGrpcProperties;
+import com.google.api.gax.grpc.GrpcTransportChannel;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
+import com.google.api.gax.longrunning.OperationSnapshot;
+import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
+import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.PagedListDescriptor;
+import com.google.api.gax.rpc.PagedListResponseFactory;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.StubSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.cloud.redis.cluster.v1.Cluster;
+import com.google.cloud.redis.cluster.v1.CreateClusterRequest;
+import com.google.cloud.redis.cluster.v1.DeleteClusterRequest;
+import com.google.cloud.redis.cluster.v1.GetClusterRequest;
+import com.google.cloud.redis.cluster.v1.ListClustersRequest;
+import com.google.cloud.redis.cluster.v1.ListClustersResponse;
+import com.google.cloud.redis.cluster.v1.UpdateClusterRequest;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+import org.threeten.bp.Duration;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link CloudRedisClusterStub}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (redis.googleapis.com) and default port (443) are used.
+ *
- Credentials are acquired automatically through Application Default Credentials.
+ *
- Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ *
For example, to set the total timeout of getCluster to 30 seconds:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CloudRedisClusterStubSettings.Builder cloudRedisClusterSettingsBuilder =
+ * CloudRedisClusterStubSettings.newBuilder();
+ * cloudRedisClusterSettingsBuilder
+ * .getClusterSettings()
+ * .setRetrySettings(
+ * cloudRedisClusterSettingsBuilder
+ * .getClusterSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * CloudRedisClusterStubSettings cloudRedisClusterSettings =
+ * cloudRedisClusterSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class CloudRedisClusterStubSettings extends StubSettings {
+ /** The default scopes of the service. */
+ private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+ ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
+
+ private final PagedCallSettings<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+ listClustersSettings;
+ private final UnaryCallSettings getClusterSettings;
+ private final UnaryCallSettings updateClusterSettings;
+ private final OperationCallSettings
+ updateClusterOperationSettings;
+ private final UnaryCallSettings deleteClusterSettings;
+ private final OperationCallSettings
+ deleteClusterOperationSettings;
+ private final UnaryCallSettings createClusterSettings;
+ private final OperationCallSettings
+ createClusterOperationSettings;
+ private final PagedCallSettings<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings;
+ private final UnaryCallSettings getLocationSettings;
+
+ private static final PagedListDescriptor
+ LIST_CLUSTERS_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListClustersRequest injectToken(ListClustersRequest payload, String token) {
+ return ListClustersRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListClustersRequest injectPageSize(ListClustersRequest payload, int pageSize) {
+ return ListClustersRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListClustersRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListClustersResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListClustersResponse payload) {
+ return payload.getClustersList() == null
+ ? ImmutableList.of()
+ : payload.getClustersList();
+ }
+ };
+
+ private static final PagedListDescriptor
+ LIST_LOCATIONS_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) {
+ return ListLocationsRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) {
+ return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListLocationsRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListLocationsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListLocationsResponse payload) {
+ return payload.getLocationsList() == null
+ ? ImmutableList.of()
+ : payload.getLocationsList();
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+ LIST_CLUSTERS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListClustersRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_CLUSTERS_PAGE_STR_DESC, request, context);
+ return ListClustersPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ LIST_LOCATIONS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListLocationsRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context);
+ return ListLocationsPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
+ /** Returns the object with the settings used for calls to listClusters. */
+ public PagedCallSettings
+ listClustersSettings() {
+ return listClustersSettings;
+ }
+
+ /** Returns the object with the settings used for calls to getCluster. */
+ public UnaryCallSettings getClusterSettings() {
+ return getClusterSettings;
+ }
+
+ /** Returns the object with the settings used for calls to updateCluster. */
+ public UnaryCallSettings updateClusterSettings() {
+ return updateClusterSettings;
+ }
+
+ /** Returns the object with the settings used for calls to updateCluster. */
+ public OperationCallSettings
+ updateClusterOperationSettings() {
+ return updateClusterOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to deleteCluster. */
+ public UnaryCallSettings deleteClusterSettings() {
+ return deleteClusterSettings;
+ }
+
+ /** Returns the object with the settings used for calls to deleteCluster. */
+ public OperationCallSettings deleteClusterOperationSettings() {
+ return deleteClusterOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to createCluster. */
+ public UnaryCallSettings createClusterSettings() {
+ return createClusterSettings;
+ }
+
+ /** Returns the object with the settings used for calls to createCluster. */
+ public OperationCallSettings
+ createClusterOperationSettings() {
+ return createClusterOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return listLocationsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return getLocationSettings;
+ }
+
+ public CloudRedisClusterStub createStub() throws IOException {
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(GrpcTransportChannel.getGrpcTransportName())) {
+ return GrpcCloudRedisClusterStub.create(this);
+ }
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonCloudRedisClusterStub.create(this);
+ }
+ throw new UnsupportedOperationException(
+ String.format(
+ "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return InstantiatingExecutorProvider.newBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return "redis.googleapis.com:443";
+ }
+
+ /** Returns the default mTLS service endpoint. */
+ public static String getDefaultMtlsEndpoint() {
+ return "redis.mtls.googleapis.com:443";
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return DEFAULT_SERVICE_SCOPES;
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
+ }
+
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return InstantiatingGrpcChannelProvider.newBuilder()
+ .setMaxInboundMessageSize(Integer.MAX_VALUE);
+ }
+
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return defaultGrpcTransportProviderBuilder().build();
+ }
+
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(CloudRedisClusterStubSettings.class))
+ .setTransportToken(
+ GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
+ }
+
+ @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(CloudRedisClusterStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return CloudRedisClusterStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
+ /** Returns a new builder for this class. */
+ public static Builder newBuilder(ClientContext clientContext) {
+ return new Builder(clientContext);
+ }
+
+ /** Returns a builder containing all the values of this settings class. */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ protected CloudRedisClusterStubSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+
+ listClustersSettings = settingsBuilder.listClustersSettings().build();
+ getClusterSettings = settingsBuilder.getClusterSettings().build();
+ updateClusterSettings = settingsBuilder.updateClusterSettings().build();
+ updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build();
+ deleteClusterSettings = settingsBuilder.deleteClusterSettings().build();
+ deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build();
+ createClusterSettings = settingsBuilder.createClusterSettings().build();
+ createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build();
+ listLocationsSettings = settingsBuilder.listLocationsSettings().build();
+ getLocationSettings = settingsBuilder.getLocationSettings().build();
+ }
+
+ /** Builder for CloudRedisClusterStubSettings. */
+ public static class Builder extends StubSettings.Builder {
+ private final ImmutableList> unaryMethodSettingsBuilders;
+ private final PagedCallSettings.Builder<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+ listClustersSettings;
+ private final UnaryCallSettings.Builder getClusterSettings;
+ private final UnaryCallSettings.Builder updateClusterSettings;
+ private final OperationCallSettings.Builder
+ updateClusterOperationSettings;
+ private final UnaryCallSettings.Builder deleteClusterSettings;
+ private final OperationCallSettings.Builder
+ deleteClusterOperationSettings;
+ private final UnaryCallSettings.Builder createClusterSettings;
+ private final OperationCallSettings.Builder
+ createClusterOperationSettings;
+ private final PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings;
+ private final UnaryCallSettings.Builder getLocationSettings;
+ private static final ImmutableMap>
+ RETRYABLE_CODE_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder> definitions =
+ ImmutableMap.builder();
+ definitions.put(
+ "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList()));
+ definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList()));
+ RETRYABLE_CODE_DEFINITIONS = definitions.build();
+ }
+
+ private static final ImmutableMap RETRY_PARAM_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder definitions = ImmutableMap.builder();
+ RetrySettings settings = null;
+ settings =
+ RetrySettings.newBuilder()
+ .setInitialRpcTimeout(Duration.ofMillis(600000L))
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ofMillis(600000L))
+ .setTotalTimeout(Duration.ofMillis(600000L))
+ .build();
+ definitions.put("no_retry_0_params", settings);
+ settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
+ definitions.put("no_retry_params", settings);
+ RETRY_PARAM_DEFINITIONS = definitions.build();
+ }
+
+ protected Builder() {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(clientContext);
+
+ listClustersSettings = PagedCallSettings.newBuilder(LIST_CLUSTERS_PAGE_STR_FACT);
+ getClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ updateClusterOperationSettings = OperationCallSettings.newBuilder();
+ deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ deleteClusterOperationSettings = OperationCallSettings.newBuilder();
+ createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ createClusterOperationSettings = OperationCallSettings.newBuilder();
+ listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
+ getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+ unaryMethodSettingsBuilders =
+ ImmutableList.>of(
+ listClustersSettings,
+ getClusterSettings,
+ updateClusterSettings,
+ deleteClusterSettings,
+ createClusterSettings,
+ listLocationsSettings,
+ getLocationSettings);
+ initDefaults(this);
+ }
+
+ protected Builder(CloudRedisClusterStubSettings settings) {
+ super(settings);
+
+ listClustersSettings = settings.listClustersSettings.toBuilder();
+ getClusterSettings = settings.getClusterSettings.toBuilder();
+ updateClusterSettings = settings.updateClusterSettings.toBuilder();
+ updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder();
+ deleteClusterSettings = settings.deleteClusterSettings.toBuilder();
+ deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder();
+ createClusterSettings = settings.createClusterSettings.toBuilder();
+ createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder();
+ listLocationsSettings = settings.listLocationsSettings.toBuilder();
+ getLocationSettings = settings.getLocationSettings.toBuilder();
+
+ unaryMethodSettingsBuilders =
+ ImmutableList.>of(
+ listClustersSettings,
+ getClusterSettings,
+ updateClusterSettings,
+ deleteClusterSettings,
+ createClusterSettings,
+ listLocationsSettings,
+ getLocationSettings);
+ }
+
+ private static Builder createDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultTransportChannelProvider());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setEndpoint(getDefaultEndpoint());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
+ private static Builder initDefaults(Builder builder) {
+ builder
+ .listClustersSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
+
+ builder
+ .getClusterSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
+
+ builder
+ .updateClusterSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
+
+ builder
+ .deleteClusterSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
+
+ builder
+ .createClusterSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
+
+ builder
+ .listLocationsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .getLocationSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .updateClusterOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
+ .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(60000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(360000L))
+ .setInitialRpcTimeout(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ZERO)
+ .setTotalTimeout(Duration.ofMillis(7200000L))
+ .build()));
+
+ builder
+ .deleteClusterOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
+ .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(60000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(360000L))
+ .setInitialRpcTimeout(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ZERO)
+ .setTotalTimeout(Duration.ofMillis(1200000L))
+ .build()));
+
+ builder
+ .createClusterOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Cluster.class))
+ .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(60000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(360000L))
+ .setInitialRpcTimeout(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.ZERO)
+ .setTotalTimeout(Duration.ofMillis(7200000L))
+ .build()));
+
+ return builder;
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
+ return this;
+ }
+
+ public ImmutableList> unaryMethodSettingsBuilders() {
+ return unaryMethodSettingsBuilders;
+ }
+
+ /** Returns the builder for the settings used for calls to listClusters. */
+ public PagedCallSettings.Builder<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+ listClustersSettings() {
+ return listClustersSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to getCluster. */
+ public UnaryCallSettings.Builder getClusterSettings() {
+ return getClusterSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to updateCluster. */
+ public UnaryCallSettings.Builder updateClusterSettings() {
+ return updateClusterSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to updateCluster. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ updateClusterOperationSettings() {
+ return updateClusterOperationSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to deleteCluster. */
+ public UnaryCallSettings.Builder deleteClusterSettings() {
+ return deleteClusterSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to deleteCluster. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ deleteClusterOperationSettings() {
+ return deleteClusterOperationSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to createCluster. */
+ public UnaryCallSettings.Builder createClusterSettings() {
+ return createClusterSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to createCluster. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ createClusterOperationSettings() {
+ return createClusterOperationSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return listLocationsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getLocationSettings;
+ }
+
+ @Override
+ public CloudRedisClusterStubSettings build() throws IOException {
+ return new CloudRedisClusterStubSettings(this);
+ }
+ }
+}
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterCallableFactory.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterCallableFactory.java
new file mode 100644
index 000000000000..5e2a6deb808e
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterCallableFactory.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.redis.cluster.v1.stub;
+
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the CloudRedisCluster service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcCloudRedisClusterCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ GrpcCallSettings grpcCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ GrpcCallSettings grpcCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ GrpcCallSettings grpcCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBatchingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ GrpcCallSettings grpcCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ return GrpcCallableFactory.createOperationCallable(
+ grpcCallSettings, callSettings, clientContext, operationsStub);
+ }
+
+ @Override
+ public
+ BidiStreamingCallable createBidiStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBidiStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createServerStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ ClientStreamingCallable createClientStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createClientStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterStub.java
new file mode 100644
index 000000000000..d42210cfc4b4
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterStub.java
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.redis.cluster.v1.stub;
+
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse;
+import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.RequestParamsBuilder;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.cloud.redis.cluster.v1.Cluster;
+import com.google.cloud.redis.cluster.v1.CreateClusterRequest;
+import com.google.cloud.redis.cluster.v1.DeleteClusterRequest;
+import com.google.cloud.redis.cluster.v1.GetClusterRequest;
+import com.google.cloud.redis.cluster.v1.ListClustersRequest;
+import com.google.cloud.redis.cluster.v1.ListClustersResponse;
+import com.google.cloud.redis.cluster.v1.UpdateClusterRequest;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.GrpcOperationsStub;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import io.grpc.MethodDescriptor;
+import io.grpc.protobuf.ProtoUtils;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC stub implementation for the CloudRedisCluster service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcCloudRedisClusterStub extends CloudRedisClusterStub {
+ private static final MethodDescriptor
+ listClustersMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/ListClusters")
+ .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor getClusterMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/GetCluster")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ updateClusterMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/UpdateCluster")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(UpdateClusterRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ deleteClusterMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/DeleteCluster")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ createClusterMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor
+ listLocationsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.location.Locations/ListLocations")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
+ .build();
+
+ private static final MethodDescriptor getLocationMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.location.Locations/GetLocation")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
+ .build();
+
+ private final UnaryCallable listClustersCallable;
+ private final UnaryCallable
+ listClustersPagedCallable;
+ private final UnaryCallable getClusterCallable;
+ private final UnaryCallable updateClusterCallable;
+ private final OperationCallable
+ updateClusterOperationCallable;
+ private final UnaryCallable deleteClusterCallable;
+ private final OperationCallable deleteClusterOperationCallable;
+ private final UnaryCallable createClusterCallable;
+ private final OperationCallable
+ createClusterOperationCallable;
+ private final UnaryCallable listLocationsCallable;
+ private final UnaryCallable
+ listLocationsPagedCallable;
+ private final UnaryCallable getLocationCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final GrpcOperationsStub operationsStub;
+ private final GrpcStubCallableFactory callableFactory;
+
+ public static final GrpcCloudRedisClusterStub create(CloudRedisClusterStubSettings settings)
+ throws IOException {
+ return new GrpcCloudRedisClusterStub(settings, ClientContext.create(settings));
+ }
+
+ public static final GrpcCloudRedisClusterStub create(ClientContext clientContext)
+ throws IOException {
+ return new GrpcCloudRedisClusterStub(
+ CloudRedisClusterStubSettings.newBuilder().build(), clientContext);
+ }
+
+ public static final GrpcCloudRedisClusterStub create(
+ ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
+ return new GrpcCloudRedisClusterStub(
+ CloudRedisClusterStubSettings.newBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of GrpcCloudRedisClusterStub, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected GrpcCloudRedisClusterStub(
+ CloudRedisClusterStubSettings settings, ClientContext clientContext) throws IOException {
+ this(settings, clientContext, new GrpcCloudRedisClusterCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of GrpcCloudRedisClusterStub, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected GrpcCloudRedisClusterStub(
+ CloudRedisClusterStubSettings settings,
+ ClientContext clientContext,
+ GrpcStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
+
+ GrpcCallSettings listClustersTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listClustersMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings getClusterTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getClusterMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings updateClusterTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(updateClusterMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("cluster.name", String.valueOf(request.getCluster().getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings deleteClusterTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteClusterMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings createClusterTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createClusterMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings listLocationsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listLocationsMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings getLocationTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getLocationMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+
+ this.listClustersCallable =
+ callableFactory.createUnaryCallable(
+ listClustersTransportSettings, settings.listClustersSettings(), clientContext);
+ this.listClustersPagedCallable =
+ callableFactory.createPagedCallable(
+ listClustersTransportSettings, settings.listClustersSettings(), clientContext);
+ this.getClusterCallable =
+ callableFactory.createUnaryCallable(
+ getClusterTransportSettings, settings.getClusterSettings(), clientContext);
+ this.updateClusterCallable =
+ callableFactory.createUnaryCallable(
+ updateClusterTransportSettings, settings.updateClusterSettings(), clientContext);
+ this.updateClusterOperationCallable =
+ callableFactory.createOperationCallable(
+ updateClusterTransportSettings,
+ settings.updateClusterOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.deleteClusterCallable =
+ callableFactory.createUnaryCallable(
+ deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext);
+ this.deleteClusterOperationCallable =
+ callableFactory.createOperationCallable(
+ deleteClusterTransportSettings,
+ settings.deleteClusterOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.createClusterCallable =
+ callableFactory.createUnaryCallable(
+ createClusterTransportSettings, settings.createClusterSettings(), clientContext);
+ this.createClusterOperationCallable =
+ callableFactory.createOperationCallable(
+ createClusterTransportSettings,
+ settings.createClusterOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.listLocationsCallable =
+ callableFactory.createUnaryCallable(
+ listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
+ this.listLocationsPagedCallable =
+ callableFactory.createPagedCallable(
+ listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
+ this.getLocationCallable =
+ callableFactory.createUnaryCallable(
+ getLocationTransportSettings, settings.getLocationSettings(), clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ public GrpcOperationsStub getOperationsStub() {
+ return operationsStub;
+ }
+
+ @Override
+ public UnaryCallable listClustersCallable() {
+ return listClustersCallable;
+ }
+
+ @Override
+ public UnaryCallable listClustersPagedCallable() {
+ return listClustersPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getClusterCallable() {
+ return getClusterCallable;
+ }
+
+ @Override
+ public UnaryCallable updateClusterCallable() {
+ return updateClusterCallable;
+ }
+
+ @Override
+ public OperationCallable updateClusterOperationCallable() {
+ return updateClusterOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteClusterCallable() {
+ return deleteClusterCallable;
+ }
+
+ @Override
+ public OperationCallable deleteClusterOperationCallable() {
+ return deleteClusterOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable createClusterCallable() {
+ return createClusterCallable;
+ }
+
+ @Override
+ public OperationCallable createClusterOperationCallable() {
+ return createClusterOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable listLocationsCallable() {
+ return listLocationsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listLocationsPagedCallable() {
+ return listLocationsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getLocationCallable() {
+ return getLocationCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterCallableFactory.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterCallableFactory.java
new file mode 100644
index 000000000000..7473249f19ff
--- /dev/null
+++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2023 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.redis.cluster.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the CloudRedisCluster service API.
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+@BetaApi
+public class HttpJsonCloudRedisClusterCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable