Search in sources :

Example 1 with GetImportJobRequest

use of com.google.cloud.kms.v1.GetImportJobRequest in project gapic-generator-java by googleapis.

the class AsyncGetImportJob method asyncGetImportJob.

public static void asyncGetImportJob() throws Exception {
    // It may require modifications to work in your environment.
    try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
        GetImportJobRequest request = GetImportJobRequest.newBuilder().setName(ImportJobName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]").toString()).build();
        ApiFuture<ImportJob> future = keyManagementServiceClient.getImportJobCallable().futureCall(request);
        // Do something.
        ImportJob response = future.get();
    }
}
Also used : ImportJob(com.google.cloud.kms.v1.ImportJob) KeyManagementServiceClient(com.google.cloud.kms.v1.KeyManagementServiceClient) GetImportJobRequest(com.google.cloud.kms.v1.GetImportJobRequest)

Example 2 with GetImportJobRequest

use of com.google.cloud.kms.v1.GetImportJobRequest in project gapic-generator-java by googleapis.

the class SyncGetImportJob method syncGetImportJob.

public static void syncGetImportJob() throws Exception {
    // It may require modifications to work in your environment.
    try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
        GetImportJobRequest request = GetImportJobRequest.newBuilder().setName(ImportJobName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]").toString()).build();
        ImportJob response = keyManagementServiceClient.getImportJob(request);
    }
}
Also used : ImportJob(com.google.cloud.kms.v1.ImportJob) KeyManagementServiceClient(com.google.cloud.kms.v1.KeyManagementServiceClient) GetImportJobRequest(com.google.cloud.kms.v1.GetImportJobRequest)

Aggregations

GetImportJobRequest (com.google.cloud.kms.v1.GetImportJobRequest)2 ImportJob (com.google.cloud.kms.v1.ImportJob)2 KeyManagementServiceClient (com.google.cloud.kms.v1.KeyManagementServiceClient)2