@@ -188,8 +188,9 @@ public final OperationsClient getOperationsClient() {
188188 * Lists all Redis instances owned by a project in either the specified location (region) or all
189189 * locations.
190190 *
191- * <p>The location should have the following format: *
192- * `projects/{project_id}/locations/{location_id}`
191+ * <p>The location should have the following format:
192+ *
193+ * <p>* `projects/{project_id}/locations/{location_id}`
193194 *
194195 * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
195196 * are queried, and the results are aggregated.
@@ -222,8 +223,9 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) {
222223 * Lists all Redis instances owned by a project in either the specified location (region) or all
223224 * locations.
224225 *
225- * <p>The location should have the following format: *
226- * `projects/{project_id}/locations/{location_id}`
226+ * <p>The location should have the following format:
227+ *
228+ * <p>* `projects/{project_id}/locations/{location_id}`
227229 *
228230 * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
229231 * are queried, and the results are aggregated.
@@ -253,8 +255,9 @@ public final ListInstancesPagedResponse listInstances(String parent) {
253255 * Lists all Redis instances owned by a project in either the specified location (region) or all
254256 * locations.
255257 *
256- * <p>The location should have the following format: *
257- * `projects/{project_id}/locations/{location_id}`
258+ * <p>The location should have the following format:
259+ *
260+ * <p>* `projects/{project_id}/locations/{location_id}`
258261 *
259262 * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
260263 * are queried, and the results are aggregated.
@@ -285,8 +288,9 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
285288 * Lists all Redis instances owned by a project in either the specified location (region) or all
286289 * locations.
287290 *
288- * <p>The location should have the following format: *
289- * `projects/{project_id}/locations/{location_id}`
291+ * <p>The location should have the following format:
292+ *
293+ * <p>* `projects/{project_id}/locations/{location_id}`
290294 *
291295 * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
292296 * are queried, and the results are aggregated.
@@ -317,8 +321,9 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
317321 * Lists all Redis instances owned by a project in either the specified location (region) or all
318322 * locations.
319323 *
320- * <p>The location should have the following format: *
321- * `projects/{project_id}/locations/{location_id}`
324+ * <p>The location should have the following format:
325+ *
326+ * <p>* `projects/{project_id}/locations/{location_id}`
322327 *
323328 * <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
324329 * are queried, and the results are aggregated.
@@ -1365,6 +1370,144 @@ public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCalla
13651370 return stub .deleteInstanceCallable ();
13661371 }
13671372
1373+ // AUTO-GENERATED DOCUMENTATION AND METHOD
1374+ /**
1375+ * Upgrades Redis instance to the newer Redis version specified in the request.
1376+ *
1377+ * <p>Sample code:
1378+ *
1379+ * <pre><code>
1380+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1381+ * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
1382+ * String redisVersion = "";
1383+ * Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get();
1384+ * }
1385+ * </code></pre>
1386+ *
1387+ * @param name Required. Redis instance resource name using the form:
1388+ * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
1389+ * refers to a GCP region.
1390+ * @param redisVersion Required. Specifies the target version of Redis software to upgrade to.
1391+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1392+ */
1393+ @ BetaApi (
1394+ "The surface for long-running operations is not stable yet and may change in the future." )
1395+ public final OperationFuture <Instance , Any > upgradeInstanceAsync (
1396+ InstanceName name , String redisVersion ) {
1397+ UpgradeInstanceRequest request =
1398+ UpgradeInstanceRequest .newBuilder ()
1399+ .setName (name == null ? null : name .toString ())
1400+ .setRedisVersion (redisVersion )
1401+ .build ();
1402+ return upgradeInstanceAsync (request );
1403+ }
1404+
1405+ // AUTO-GENERATED DOCUMENTATION AND METHOD
1406+ /**
1407+ * Upgrades Redis instance to the newer Redis version specified in the request.
1408+ *
1409+ * <p>Sample code:
1410+ *
1411+ * <pre><code>
1412+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1413+ * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
1414+ * String redisVersion = "";
1415+ * Instance response = cloudRedisClient.upgradeInstanceAsync(name.toString(), redisVersion).get();
1416+ * }
1417+ * </code></pre>
1418+ *
1419+ * @param name Required. Redis instance resource name using the form:
1420+ * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
1421+ * refers to a GCP region.
1422+ * @param redisVersion Required. Specifies the target version of Redis software to upgrade to.
1423+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1424+ */
1425+ @ BetaApi (
1426+ "The surface for long-running operations is not stable yet and may change in the future." )
1427+ public final OperationFuture <Instance , Any > upgradeInstanceAsync (
1428+ String name , String redisVersion ) {
1429+ UpgradeInstanceRequest request =
1430+ UpgradeInstanceRequest .newBuilder ().setName (name ).setRedisVersion (redisVersion ).build ();
1431+ return upgradeInstanceAsync (request );
1432+ }
1433+
1434+ // AUTO-GENERATED DOCUMENTATION AND METHOD
1435+ /**
1436+ * Upgrades Redis instance to the newer Redis version specified in the request.
1437+ *
1438+ * <p>Sample code:
1439+ *
1440+ * <pre><code>
1441+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1442+ * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
1443+ * String redisVersion = "";
1444+ * UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
1445+ * .setName(name.toString())
1446+ * .setRedisVersion(redisVersion)
1447+ * .build();
1448+ * Instance response = cloudRedisClient.upgradeInstanceAsync(request).get();
1449+ * }
1450+ * </code></pre>
1451+ *
1452+ * @param request The request object containing all of the parameters for the API call.
1453+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1454+ */
1455+ @ BetaApi (
1456+ "The surface for long-running operations is not stable yet and may change in the future." )
1457+ public final OperationFuture <Instance , Any > upgradeInstanceAsync (UpgradeInstanceRequest request ) {
1458+ return upgradeInstanceOperationCallable ().futureCall (request );
1459+ }
1460+
1461+ // AUTO-GENERATED DOCUMENTATION AND METHOD
1462+ /**
1463+ * Upgrades Redis instance to the newer Redis version specified in the request.
1464+ *
1465+ * <p>Sample code:
1466+ *
1467+ * <pre><code>
1468+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1469+ * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
1470+ * String redisVersion = "";
1471+ * UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
1472+ * .setName(name.toString())
1473+ * .setRedisVersion(redisVersion)
1474+ * .build();
1475+ * OperationFuture<Instance, Any> future = cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request);
1476+ * // Do something
1477+ * Instance response = future.get();
1478+ * }
1479+ * </code></pre>
1480+ */
1481+ @ BetaApi ("The surface for use by generated code is not stable yet and may change in the future." )
1482+ public final OperationCallable <UpgradeInstanceRequest , Instance , Any >
1483+ upgradeInstanceOperationCallable () {
1484+ return stub .upgradeInstanceOperationCallable ();
1485+ }
1486+
1487+ // AUTO-GENERATED DOCUMENTATION AND METHOD
1488+ /**
1489+ * Upgrades Redis instance to the newer Redis version specified in the request.
1490+ *
1491+ * <p>Sample code:
1492+ *
1493+ * <pre><code>
1494+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1495+ * InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
1496+ * String redisVersion = "";
1497+ * UpgradeInstanceRequest request = UpgradeInstanceRequest.newBuilder()
1498+ * .setName(name.toString())
1499+ * .setRedisVersion(redisVersion)
1500+ * .build();
1501+ * ApiFuture<Operation> future = cloudRedisClient.upgradeInstanceCallable().futureCall(request);
1502+ * // Do something
1503+ * Operation response = future.get();
1504+ * }
1505+ * </code></pre>
1506+ */
1507+ public final UnaryCallable <UpgradeInstanceRequest , Operation > upgradeInstanceCallable () {
1508+ return stub .upgradeInstanceCallable ();
1509+ }
1510+
13681511 @ Override
13691512 public final void close () {
13701513 stub .close ();
0 commit comments