Search in sources :

Example 1 with ListFeedsResponse

use of com.google.cloud.asset.v1.ListFeedsResponse in project java-asset by googleapis.

the class ListFeedsExample method listFeeds.

// List feeds in a project.
public static void listFeeds(String projectId) throws Exception {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (AssetServiceClient client = AssetServiceClient.create()) {
        ListFeedsResponse response = client.listFeeds(ProjectName.of(projectId).toString());
        System.out.println("Listed feeds under: " + projectId);
    } catch (Exception e) {
        System.out.println("Error during ListFeeds: \n" + e.toString());
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Example 2 with ListFeedsResponse

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

the class AsyncListFeeds method asyncListFeeds.

public static void asyncListFeeds() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        ListFeedsRequest request = ListFeedsRequest.newBuilder().setParent("parent-995424086").build();
        ApiFuture<ListFeedsResponse> future = assetServiceClient.listFeedsCallable().futureCall(request);
        // Do something.
        ListFeedsResponse response = future.get();
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsRequest(com.google.cloud.asset.v1.ListFeedsRequest) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Example 3 with ListFeedsResponse

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

the class SyncListFeeds method syncListFeeds.

public static void syncListFeeds() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        ListFeedsRequest request = ListFeedsRequest.newBuilder().setParent("parent-995424086").build();
        ListFeedsResponse response = assetServiceClient.listFeeds(request);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsRequest(com.google.cloud.asset.v1.ListFeedsRequest) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Example 4 with ListFeedsResponse

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

the class SyncListFeedsString method syncListFeedsString.

public static void syncListFeedsString() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        String parent = "parent-995424086";
        ListFeedsResponse response = assetServiceClient.listFeeds(parent);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Aggregations

AssetServiceClient (com.google.cloud.asset.v1.AssetServiceClient)4 ListFeedsResponse (com.google.cloud.asset.v1.ListFeedsResponse)4 ListFeedsRequest (com.google.cloud.asset.v1.ListFeedsRequest)2