Search in sources :

Example 1 with GetInstanceAuthStringRequest

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();
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) GetInstanceAuthStringRequest(com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Example 2 with GetInstanceAuthStringRequest

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);
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) GetInstanceAuthStringRequest(com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Aggregations

CloudRedisClient (com.google.cloud.redis.v1beta1.CloudRedisClient)2 GetInstanceAuthStringRequest (com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest)2 InstanceAuthString (com.google.cloud.redis.v1beta1.InstanceAuthString)2