Search in sources :

Example 1 with GetFeedRequest

use of com.google.cloud.asset.v1.GetFeedRequest in project gapic-generator-java by googleapis.

the class AsyncGetFeed method asyncGetFeed.

public static void asyncGetFeed() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        GetFeedRequest request = GetFeedRequest.newBuilder().setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()).build();
        ApiFuture<Feed> future = assetServiceClient.getFeedCallable().futureCall(request);
        // Do something.
        Feed response = future.get();
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) GetFeedRequest(com.google.cloud.asset.v1.GetFeedRequest) Feed(com.google.cloud.asset.v1.Feed)

Example 2 with GetFeedRequest

use of com.google.cloud.asset.v1.GetFeedRequest in project gapic-generator-java by googleapis.

the class SyncGetFeed method syncGetFeed.

public static void syncGetFeed() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        GetFeedRequest request = GetFeedRequest.newBuilder().setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()).build();
        Feed response = assetServiceClient.getFeed(request);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) GetFeedRequest(com.google.cloud.asset.v1.GetFeedRequest) Feed(com.google.cloud.asset.v1.Feed)

Aggregations

AssetServiceClient (com.google.cloud.asset.v1.AssetServiceClient)2 Feed (com.google.cloud.asset.v1.Feed)2 GetFeedRequest (com.google.cloud.asset.v1.GetFeedRequest)2