Skip to content

Commit 6750e8e

Browse files
feat: [redis] [Cloud Memorystore for Redis] Add CMEK key field (#9411)
- [ ] Regenerate this pull request now. feat: [Cloud Memorystore for Redis] Add suspension_reasons field feat: [Cloud Memorystore for Redis] Add persistence support feat: [Cloud Memorystore for Redis] Add self service update maintenance version support PiperOrigin-RevId: 529822563 Source-Link: https://togithub.com/googleapis/googleapis/commit/6a0ac6d06db9019ffc37f079db79f027f95eff9f Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/66da9c322deb75fb89d5a3505f572644d4f07698 Copy-Tag: eyJwIjoiamF2YS1yZWRpcy8uT3dsQm90LnlhbWwiLCJoIjoiNjZkYTljMzIyZGViNzVmYjg5ZDVhMzUwNWY1NzI2NDRkNGYwNzY5OCJ9
1 parent 487e38d commit 6750e8e

37 files changed

Lines changed: 8261 additions & 2856 deletions

java-redis/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.11.0</version>
23+
<version>26.14.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-redis.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-redis/2.17.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-redis/2.19.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-redis/google-cloud-redis/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
<artifactId>grpc-google-cloud-redis-v1</artifactId>
9292
<scope>test</scope>
9393
</dependency>
94+
<dependency>
95+
<groupId>com.google.api.grpc</groupId>
96+
<artifactId>grpc-google-common-protos</artifactId>
97+
</dependency>
9498
<!-- Need testing utility classes for generated gRPC clients tests -->
9599
<dependency>
96100
<groupId>com.google.api</groupId>

java-redis/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
import com.google.api.gax.rpc.OperationCallable;
2929
import com.google.api.gax.rpc.PageContext;
3030
import com.google.api.gax.rpc.UnaryCallable;
31+
import com.google.cloud.location.GetLocationRequest;
32+
import com.google.cloud.location.ListLocationsRequest;
33+
import com.google.cloud.location.ListLocationsResponse;
34+
import com.google.cloud.location.Location;
3135
import com.google.cloud.redis.v1.stub.CloudRedisStub;
3236
import com.google.cloud.redis.v1.stub.CloudRedisStubSettings;
3337
import com.google.common.util.concurrent.MoreExecutors;
@@ -1966,6 +1970,161 @@ public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceA
19661970
return stub.rescheduleMaintenanceCallable();
19671971
}
19681972

1973+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1974+
/**
1975+
* Lists information about the supported locations for this service.
1976+
*
1977+
* <p>Sample code:
1978+
*
1979+
* <pre>{@code
1980+
* // This snippet has been automatically generated and should be regarded as a code template only.
1981+
* // It will require modifications to work:
1982+
* // - It may require correct/in-range values for request initialization.
1983+
* // - It may require specifying regional endpoints when creating the service client as shown in
1984+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1985+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1986+
* ListLocationsRequest request =
1987+
* ListLocationsRequest.newBuilder()
1988+
* .setName("name3373707")
1989+
* .setFilter("filter-1274492040")
1990+
* .setPageSize(883849137)
1991+
* .setPageToken("pageToken873572522")
1992+
* .build();
1993+
* for (Location element : cloudRedisClient.listLocations(request).iterateAll()) {
1994+
* // doThingsWith(element);
1995+
* }
1996+
* }
1997+
* }</pre>
1998+
*
1999+
* @param request The request object containing all of the parameters for the API call.
2000+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
2001+
*/
2002+
public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
2003+
return listLocationsPagedCallable().call(request);
2004+
}
2005+
2006+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
2007+
/**
2008+
* Lists information about the supported locations for this service.
2009+
*
2010+
* <p>Sample code:
2011+
*
2012+
* <pre>{@code
2013+
* // This snippet has been automatically generated and should be regarded as a code template only.
2014+
* // It will require modifications to work:
2015+
* // - It may require correct/in-range values for request initialization.
2016+
* // - It may require specifying regional endpoints when creating the service client as shown in
2017+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2018+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
2019+
* ListLocationsRequest request =
2020+
* ListLocationsRequest.newBuilder()
2021+
* .setName("name3373707")
2022+
* .setFilter("filter-1274492040")
2023+
* .setPageSize(883849137)
2024+
* .setPageToken("pageToken873572522")
2025+
* .build();
2026+
* ApiFuture<Location> future =
2027+
* cloudRedisClient.listLocationsPagedCallable().futureCall(request);
2028+
* // Do something.
2029+
* for (Location element : future.get().iterateAll()) {
2030+
* // doThingsWith(element);
2031+
* }
2032+
* }
2033+
* }</pre>
2034+
*/
2035+
public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
2036+
listLocationsPagedCallable() {
2037+
return stub.listLocationsPagedCallable();
2038+
}
2039+
2040+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
2041+
/**
2042+
* Lists information about the supported locations for this service.
2043+
*
2044+
* <p>Sample code:
2045+
*
2046+
* <pre>{@code
2047+
* // This snippet has been automatically generated and should be regarded as a code template only.
2048+
* // It will require modifications to work:
2049+
* // - It may require correct/in-range values for request initialization.
2050+
* // - It may require specifying regional endpoints when creating the service client as shown in
2051+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2052+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
2053+
* ListLocationsRequest request =
2054+
* ListLocationsRequest.newBuilder()
2055+
* .setName("name3373707")
2056+
* .setFilter("filter-1274492040")
2057+
* .setPageSize(883849137)
2058+
* .setPageToken("pageToken873572522")
2059+
* .build();
2060+
* while (true) {
2061+
* ListLocationsResponse response = cloudRedisClient.listLocationsCallable().call(request);
2062+
* for (Location element : response.getLocationsList()) {
2063+
* // doThingsWith(element);
2064+
* }
2065+
* String nextPageToken = response.getNextPageToken();
2066+
* if (!Strings.isNullOrEmpty(nextPageToken)) {
2067+
* request = request.toBuilder().setPageToken(nextPageToken).build();
2068+
* } else {
2069+
* break;
2070+
* }
2071+
* }
2072+
* }
2073+
* }</pre>
2074+
*/
2075+
public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
2076+
return stub.listLocationsCallable();
2077+
}
2078+
2079+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
2080+
/**
2081+
* Gets information about a location.
2082+
*
2083+
* <p>Sample code:
2084+
*
2085+
* <pre>{@code
2086+
* // This snippet has been automatically generated and should be regarded as a code template only.
2087+
* // It will require modifications to work:
2088+
* // - It may require correct/in-range values for request initialization.
2089+
* // - It may require specifying regional endpoints when creating the service client as shown in
2090+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2091+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
2092+
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
2093+
* Location response = cloudRedisClient.getLocation(request);
2094+
* }
2095+
* }</pre>
2096+
*
2097+
* @param request The request object containing all of the parameters for the API call.
2098+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
2099+
*/
2100+
public final Location getLocation(GetLocationRequest request) {
2101+
return getLocationCallable().call(request);
2102+
}
2103+
2104+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
2105+
/**
2106+
* Gets information about a location.
2107+
*
2108+
* <p>Sample code:
2109+
*
2110+
* <pre>{@code
2111+
* // This snippet has been automatically generated and should be regarded as a code template only.
2112+
* // It will require modifications to work:
2113+
* // - It may require correct/in-range values for request initialization.
2114+
* // - It may require specifying regional endpoints when creating the service client as shown in
2115+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2116+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
2117+
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
2118+
* ApiFuture<Location> future = cloudRedisClient.getLocationCallable().futureCall(request);
2119+
* // Do something.
2120+
* Location response = future.get();
2121+
* }
2122+
* }</pre>
2123+
*/
2124+
public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
2125+
return stub.getLocationCallable();
2126+
}
2127+
19692128
@Override
19702129
public final void close() {
19712130
stub.close();
@@ -2071,4 +2230,80 @@ protected ListInstancesFixedSizeCollection createCollection(
20712230
return new ListInstancesFixedSizeCollection(pages, collectionSize);
20722231
}
20732232
}
2233+
2234+
public static class ListLocationsPagedResponse
2235+
extends AbstractPagedListResponse<
2236+
ListLocationsRequest,
2237+
ListLocationsResponse,
2238+
Location,
2239+
ListLocationsPage,
2240+
ListLocationsFixedSizeCollection> {
2241+
2242+
public static ApiFuture<ListLocationsPagedResponse> createAsync(
2243+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2244+
ApiFuture<ListLocationsResponse> futureResponse) {
2245+
ApiFuture<ListLocationsPage> futurePage =
2246+
ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
2247+
return ApiFutures.transform(
2248+
futurePage,
2249+
input -> new ListLocationsPagedResponse(input),
2250+
MoreExecutors.directExecutor());
2251+
}
2252+
2253+
private ListLocationsPagedResponse(ListLocationsPage page) {
2254+
super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
2255+
}
2256+
}
2257+
2258+
public static class ListLocationsPage
2259+
extends AbstractPage<
2260+
ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
2261+
2262+
private ListLocationsPage(
2263+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2264+
ListLocationsResponse response) {
2265+
super(context, response);
2266+
}
2267+
2268+
private static ListLocationsPage createEmptyPage() {
2269+
return new ListLocationsPage(null, null);
2270+
}
2271+
2272+
@Override
2273+
protected ListLocationsPage createPage(
2274+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2275+
ListLocationsResponse response) {
2276+
return new ListLocationsPage(context, response);
2277+
}
2278+
2279+
@Override
2280+
public ApiFuture<ListLocationsPage> createPageAsync(
2281+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2282+
ApiFuture<ListLocationsResponse> futureResponse) {
2283+
return super.createPageAsync(context, futureResponse);
2284+
}
2285+
}
2286+
2287+
public static class ListLocationsFixedSizeCollection
2288+
extends AbstractFixedSizeCollection<
2289+
ListLocationsRequest,
2290+
ListLocationsResponse,
2291+
Location,
2292+
ListLocationsPage,
2293+
ListLocationsFixedSizeCollection> {
2294+
2295+
private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) {
2296+
super(pages, collectionSize);
2297+
}
2298+
2299+
private static ListLocationsFixedSizeCollection createEmptyCollection() {
2300+
return new ListLocationsFixedSizeCollection(null, 0);
2301+
}
2302+
2303+
@Override
2304+
protected ListLocationsFixedSizeCollection createCollection(
2305+
List<ListLocationsPage> pages, int collectionSize) {
2306+
return new ListLocationsFixedSizeCollection(pages, collectionSize);
2307+
}
2308+
}
20742309
}

java-redis/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisSettings.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.redis.v1;
1818

1919
import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse;
20+
import static com.google.cloud.redis.v1.CloudRedisClient.ListLocationsPagedResponse;
2021

2122
import com.google.api.core.ApiFunction;
2223
import com.google.api.core.BetaApi;
@@ -31,6 +32,10 @@
3132
import com.google.api.gax.rpc.PagedCallSettings;
3233
import com.google.api.gax.rpc.TransportChannelProvider;
3334
import com.google.api.gax.rpc.UnaryCallSettings;
35+
import com.google.cloud.location.GetLocationRequest;
36+
import com.google.cloud.location.ListLocationsRequest;
37+
import com.google.cloud.location.ListLocationsResponse;
38+
import com.google.cloud.location.Location;
3439
import com.google.cloud.redis.v1.stub.CloudRedisStubSettings;
3540
import com.google.longrunning.Operation;
3641
import com.google.protobuf.Empty;
@@ -183,6 +188,17 @@ public UnaryCallSettings<DeleteInstanceRequest, Operation> deleteInstanceSetting
183188
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceOperationSettings();
184189
}
185190

191+
/** Returns the object with the settings used for calls to listLocations. */
192+
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
193+
listLocationsSettings() {
194+
return ((CloudRedisStubSettings) getStubSettings()).listLocationsSettings();
195+
}
196+
197+
/** Returns the object with the settings used for calls to getLocation. */
198+
public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() {
199+
return ((CloudRedisStubSettings) getStubSettings()).getLocationSettings();
200+
}
201+
186202
public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException {
187203
return new CloudRedisSettings.Builder(stub.toBuilder()).build();
188204
}
@@ -405,6 +421,18 @@ public UnaryCallSettings.Builder<DeleteInstanceRequest, Operation> deleteInstanc
405421
return getStubSettingsBuilder().rescheduleMaintenanceOperationSettings();
406422
}
407423

424+
/** Returns the builder for the settings used for calls to listLocations. */
425+
public PagedCallSettings.Builder<
426+
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
427+
listLocationsSettings() {
428+
return getStubSettingsBuilder().listLocationsSettings();
429+
}
430+
431+
/** Returns the builder for the settings used for calls to getLocation. */
432+
public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() {
433+
return getStubSettingsBuilder().getLocationSettings();
434+
}
435+
408436
@Override
409437
public CloudRedisSettings build() throws IOException {
410438
return new CloudRedisSettings(this);

java-redis/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/gapic_metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@
2828
"GetInstanceAuthString": {
2929
"methods": ["getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthStringCallable"]
3030
},
31+
"GetLocation": {
32+
"methods": ["getLocation", "getLocationCallable"]
33+
},
3134
"ImportInstance": {
3235
"methods": ["importInstanceAsync", "importInstanceAsync", "importInstanceOperationCallable", "importInstanceCallable"]
3336
},
3437
"ListInstances": {
3538
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"]
3639
},
40+
"ListLocations": {
41+
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
42+
},
3743
"RescheduleMaintenance": {
3844
"methods": ["rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceOperationCallable", "rescheduleMaintenanceCallable"]
3945
},

java-redis/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStub.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
package com.google.cloud.redis.v1.stub;
1818

1919
import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse;
20+
import static com.google.cloud.redis.v1.CloudRedisClient.ListLocationsPagedResponse;
2021

2122
import com.google.api.gax.core.BackgroundResource;
2223
import com.google.api.gax.rpc.OperationCallable;
2324
import com.google.api.gax.rpc.UnaryCallable;
25+
import com.google.cloud.location.GetLocationRequest;
26+
import com.google.cloud.location.ListLocationsRequest;
27+
import com.google.cloud.location.ListLocationsResponse;
28+
import com.google.cloud.location.Location;
2429
import com.google.cloud.redis.v1.CreateInstanceRequest;
2530
import com.google.cloud.redis.v1.DeleteInstanceRequest;
2631
import com.google.cloud.redis.v1.ExportInstanceRequest;
@@ -149,6 +154,19 @@ public UnaryCallable<RescheduleMaintenanceRequest, Operation> rescheduleMaintena
149154
throw new UnsupportedOperationException("Not implemented: rescheduleMaintenanceCallable()");
150155
}
151156

157+
public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
158+
listLocationsPagedCallable() {
159+
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
160+
}
161+
162+
public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
163+
throw new UnsupportedOperationException("Not implemented: listLocationsCallable()");
164+
}
165+
166+
public UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
167+
throw new UnsupportedOperationException("Not implemented: getLocationCallable()");
168+
}
169+
152170
@Override
153171
public abstract void close();
154172
}

0 commit comments

Comments
 (0)