Search in sources :

Example 1 with InstanceAuthString

use of com.google.cloud.redis.v1beta1.InstanceAuthString 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 InstanceAuthString

use of com.google.cloud.redis.v1beta1.InstanceAuthString in project gapic-generator-java by googleapis.

the class SyncGetInstanceAuthStringInstancename method syncGetInstanceAuthStringInstancename.

public static void syncGetInstanceAuthStringInstancename() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
        InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
    }
}
Also used : InstanceName(com.google.cloud.redis.v1beta1.InstanceName) CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Example 3 with InstanceAuthString

use of com.google.cloud.redis.v1beta1.InstanceAuthString 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)

Example 4 with InstanceAuthString

use of com.google.cloud.redis.v1beta1.InstanceAuthString in project gapic-generator-java by googleapis.

the class SyncGetInstanceAuthStringString method syncGetInstanceAuthStringString.

public static void syncGetInstanceAuthStringString() throws Exception {
    // It may require modifications to work in your environment.
    try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
        String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
        InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
    }
}
Also used : CloudRedisClient(com.google.cloud.redis.v1beta1.CloudRedisClient) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString) InstanceAuthString(com.google.cloud.redis.v1beta1.InstanceAuthString)

Aggregations

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