Search in sources :

Example 1 with GetServiceAccountRequest

use of com.google.storage.v2.GetServiceAccountRequest in project gapic-generator-java by googleapis.

the class AsyncGetServiceAccount method asyncGetServiceAccount.

public static void asyncGetServiceAccount() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ApiFuture<ServiceAccount> future = storageClient.getServiceAccountCallable().futureCall(request);
        // Do something.
        ServiceAccount response = future.get();
    }
}
Also used : ServiceAccount(com.google.storage.v2.ServiceAccount) StorageClient(com.google.storage.v2.StorageClient) GetServiceAccountRequest(com.google.storage.v2.GetServiceAccountRequest)

Example 2 with GetServiceAccountRequest

use of com.google.storage.v2.GetServiceAccountRequest in project gapic-generator-java by googleapis.

the class SyncGetServiceAccount method syncGetServiceAccount.

public static void syncGetServiceAccount() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder().setProject(ProjectName.of("[PROJECT]").toString()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ServiceAccount response = storageClient.getServiceAccount(request);
    }
}
Also used : ServiceAccount(com.google.storage.v2.ServiceAccount) StorageClient(com.google.storage.v2.StorageClient) GetServiceAccountRequest(com.google.storage.v2.GetServiceAccountRequest)

Aggregations

GetServiceAccountRequest (com.google.storage.v2.GetServiceAccountRequest)2 ServiceAccount (com.google.storage.v2.ServiceAccount)2 StorageClient (com.google.storage.v2.StorageClient)2