use of com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest in project gapic-generator-java by googleapis.
the class AsyncGetInstanceAuthString method asyncGetInstanceAuthString.
public static void asyncGetInstanceAuthString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
GetInstanceAuthStringRequest request = GetInstanceAuthStringRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
ApiFuture<InstanceAuthString> future = cloudRedisClient.getInstanceAuthStringCallable().futureCall(request);
// Do something.
InstanceAuthString response = future.get();
}
}
use of com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest in project gapic-generator-java by googleapis.
the class SyncGetInstanceAuthString method syncGetInstanceAuthString.
public static void syncGetInstanceAuthString() throws Exception {
// It may require modifications to work in your environment.
try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
GetInstanceAuthStringRequest request = GetInstanceAuthStringRequest.newBuilder().setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()).build();
InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request);
}
}
Aggregations