Expand Up @@ -34,6 +34,7 @@ import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; Expand All @@ -49,17 +50,17 @@ * defines the following resource model for managing Redis instances: * * <ul> * <li>The service works with a collection of cloud projects, named: `/projects/*` * <li>Each project has a collection of available locations, named: `/locations/*` * <li>Each location has a collection of Redis instances, named: `/instances/*` * <li>As such, Redis instances are resources of the form: * <li> The service works with a collection of cloud projects, named: `/projects/*` * <li> Each project has a collection of available locations, named: `/locations/*` * <li> Each location has a collection of Redis instances, named: `/instances/*` * <li> As such, Redis instances are resources of the form: * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` * </ul> * * <p>Note that location_id must be referring to a GCP `region`; for example: * * <ul> * <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis` * <li> `projects/redpepper-1290/locations/us-central1/instances/my-redis` * </ul> * * <p>This class provides the ability to make remote calls to the backing service through method Expand All @@ -79,13 +80,13 @@ * methods: * * <ol> * <li>A "flattened" method. With this type of method, the fields of the request type have been * <li> A "flattened" method. With this type of method, the fields of the request type have been * converted into function parameters. It may be the case that not all fields are available as * parameters, and not every API method will have a flattened method entry point. * <li>A "request object" method. This type of method only takes one parameter, a request object, * <li> A "request object" method. This type of method only takes one parameter, a request object, * which must be constructed before the call. Not every API method will have a request object * method. * <li>A "callable" method. This type of method takes no parameters and returns an immutable API * <li> A "callable" method. This type of method takes no parameters and returns an immutable API * callable object, which can be used to initiate calls to the service. * </ol> * Expand Down Expand Up @@ -188,7 +189,7 @@ public final OperationsClient getOperationsClient() { * <p>The location should have the following format: * * <ul> * <li>`projects/{project_id}/locations/{location_id}` * <li> `projects/{project_id}/locations/{location_id}` * </ul> * * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project Expand Down Expand Up @@ -225,7 +226,7 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) { * <p>The location should have the following format: * * <ul> * <li>`projects/{project_id}/locations/{location_id}` * <li> `projects/{project_id}/locations/{location_id}` * </ul> * * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project Expand Down Expand Up @@ -259,7 +260,7 @@ public final ListInstancesPagedResponse listInstances(String parent) { * <p>The location should have the following format: * * <ul> * <li>`projects/{project_id}/locations/{location_id}` * <li> `projects/{project_id}/locations/{location_id}` * </ul> * * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project Expand Down Expand Up @@ -296,7 +297,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque * <p>The location should have the following format: * * <ul> * <li>`projects/{project_id}/locations/{location_id}` * <li> `projects/{project_id}/locations/{location_id}` * </ul> * * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project Expand Down Expand Up @@ -334,7 +335,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque * <p>The location should have the following format: * * <ul> * <li>`projects/{project_id}/locations/{location_id}` * <li> `projects/{project_id}/locations/{location_id}` * </ul> * * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project Expand Down Expand Up @@ -593,11 +594,11 @@ public final InstanceAuthString getInstanceAuthString(GetInstanceAuthStringReque * @param instanceId Required. The logical name of the Redis instance in the customer project with * the following restrictions: * <ul> * <li>Must contain only lowercase letters, numbers, and hyphens. * <li>Must start with a letter. * <li>Must be between 1-40 characters. * <li>Must end with a number or a letter. * <li>Must be unique within the customer project / location * <li> Must contain only lowercase letters, numbers, and hyphens. * <li> Must start with a letter. * <li> Must be between 1-40 characters. * <li> Must end with a number or a letter. * <li> Must be unique within the customer project / location * </ul> * * @param instance Required. A Redis [Instance] resource Expand Down Expand Up @@ -645,11 +646,11 @@ public final OperationFuture<Instance, OperationMetadata> createInstanceAsync( * @param instanceId Required. The logical name of the Redis instance in the customer project with * the following restrictions: * <ul> * <li>Must contain only lowercase letters, numbers, and hyphens. * <li>Must start with a letter. * <li>Must be between 1-40 characters. * <li>Must end with a number or a letter. * <li>Must be unique within the customer project / location * <li> Must contain only lowercase letters, numbers, and hyphens. * <li> Must start with a letter. * <li> Must be between 1-40 characters. * <li> Must end with a number or a letter. * <li> Must be unique within the customer project / location * </ul> * * @param instance Required. A Redis [Instance] resource Expand Down Expand Up @@ -1523,6 +1524,159 @@ public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCalla return stub.deleteInstanceCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Reschedule maintenance for a given instance in a given project and location. * * <p>Sample code: * * <pre>{@code * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); * RescheduleMaintenanceRequest.RescheduleType rescheduleType = * RescheduleMaintenanceRequest.RescheduleType.forNumber(0); * Timestamp scheduleTime = Timestamp.newBuilder().build(); * Instance response = * cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); * } * }</pre> * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. * @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time * as well. * @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync( InstanceName name, RescheduleMaintenanceRequest.RescheduleType rescheduleType, Timestamp scheduleTime) { RescheduleMaintenanceRequest request = RescheduleMaintenanceRequest.newBuilder() .setName(name == null ? null : name.toString()) .setRescheduleType(rescheduleType) .setScheduleTime(scheduleTime) .build(); return rescheduleMaintenanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Reschedule maintenance for a given instance in a given project and location. * * <p>Sample code: * * <pre>{@code * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); * RescheduleMaintenanceRequest.RescheduleType rescheduleType = * RescheduleMaintenanceRequest.RescheduleType.forNumber(0); * Timestamp scheduleTime = Timestamp.newBuilder().build(); * Instance response = * cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); * } * }</pre> * * @param name Required. Redis instance resource name using the form: * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` * refers to a GCP region. * @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time * as well. * @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync( String name, RescheduleMaintenanceRequest.RescheduleType rescheduleType, Timestamp scheduleTime) { RescheduleMaintenanceRequest request = RescheduleMaintenanceRequest.newBuilder() .setName(name) .setRescheduleType(rescheduleType) .setScheduleTime(scheduleTime) .build(); return rescheduleMaintenanceAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Reschedule maintenance for a given instance in a given project and location. * * <p>Sample code: * * <pre>{@code * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * RescheduleMaintenanceRequest request = * RescheduleMaintenanceRequest.newBuilder() * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) * .setScheduleTime(Timestamp.newBuilder().build()) * .build(); * Instance response = cloudRedisClient.rescheduleMaintenanceAsync(request).get(); * } * }</pre> * * @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<Instance, OperationMetadata> rescheduleMaintenanceAsync( RescheduleMaintenanceRequest request) { return rescheduleMaintenanceOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Reschedule maintenance for a given instance in a given project and location. * * <p>Sample code: * * <pre>{@code * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * RescheduleMaintenanceRequest request = * RescheduleMaintenanceRequest.newBuilder() * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) * .setScheduleTime(Timestamp.newBuilder().build()) * .build(); * OperationFuture<Instance, OperationMetadata> future = * cloudRedisClient.rescheduleMaintenanceOperationCallable().futureCall(request); * // Do something. * Instance response = future.get(); * } * }</pre> */ public final OperationCallable<RescheduleMaintenanceRequest, Instance, OperationMetadata> rescheduleMaintenanceOperationCallable() { return stub.rescheduleMaintenanceOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Reschedule maintenance for a given instance in a given project and location. * * <p>Sample code: * * <pre>{@code * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { * RescheduleMaintenanceRequest request = * RescheduleMaintenanceRequest.newBuilder() * .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) * .setScheduleTime(Timestamp.newBuilder().build()) * .build(); * ApiFuture<Operation> future = * cloudRedisClient.rescheduleMaintenanceCallable().futureCall(request); * // Do something. * Operation response = future.get(); * } * }</pre> */ public final UnaryCallable<RescheduleMaintenanceRequest, Operation> rescheduleMaintenanceCallable() { return stub.rescheduleMaintenanceCallable(); } @Override public final void close() { stub.close(); Expand Down Expand Up @@ -1555,10 +1709,7 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted public static class ListInstancesPagedResponse extends AbstractPagedListResponse< ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, ListInstancesFixedSizeCollection> { public static ApiFuture<ListInstancesPagedResponse> createAsync( Expand Down Expand Up @@ -1608,10 +1759,7 @@ public ApiFuture<ListInstancesPage> createPageAsync( public static class ListInstancesFixedSizeCollection extends AbstractFixedSizeCollection< ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, ListInstancesFixedSizeCollection> { private ListInstancesFixedSizeCollection(List<ListInstancesPage> pages, int collectionSize) { Expand Down