Search in sources :

Example 6 with ListKeyRingsRequest

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

the class AsyncListKeyRings method asyncListKeyRings.

public static void asyncListKeyRings() throws Exception {
    // It may require modifications to work in your environment.
    try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
        ListKeyRingsRequest request = ListKeyRingsRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").setFilter("filter-1274492040").setOrderBy("orderBy-1207110587").build();
        ApiFuture<KeyRing> future = keyManagementServiceClient.listKeyRingsPagedCallable().futureCall(request);
        // Do something.
        for (KeyRing element : future.get().iterateAll()) {
        // doThingsWith(element);
        }
    }
}
Also used : KeyRing(com.google.cloud.kms.v1.KeyRing) ListKeyRingsRequest(com.google.cloud.kms.v1.ListKeyRingsRequest) KeyManagementServiceClient(com.google.cloud.kms.v1.KeyManagementServiceClient)

Aggregations

ListKeyRingsPagedResponse (com.google.cloud.kms.v1.KeyManagementServiceClient.ListKeyRingsPagedResponse)4 AbstractMessage (com.google.protobuf.AbstractMessage)4 Test (org.junit.Test)4 KeyManagementServiceClient (com.google.cloud.kms.v1.KeyManagementServiceClient)2 KeyRing (com.google.cloud.kms.v1.KeyRing)2 ListKeyRingsRequest (com.google.cloud.kms.v1.ListKeyRingsRequest)2 ByteString (com.google.protobuf.ByteString)2 ListKeyRingsResponse (com.google.cloud.kms.v1.ListKeyRingsResponse)1