Search in sources :

Example 1 with Feed

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

the class SyncDeleteFeedFeedname method syncDeleteFeedFeedname.

public static void syncDeleteFeedFeedname() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
        assetServiceClient.deleteFeed(name);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) FeedName(com.google.cloud.asset.v1.FeedName)

Example 2 with Feed

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

the class SyncDeleteFeedString method syncDeleteFeedString.

public static void syncDeleteFeedString() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        String name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString();
        assetServiceClient.deleteFeed(name);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient)

Example 3 with Feed

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

the class AsyncExportAssets method asyncExportAssets.

public static void asyncExportAssets() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        ExportAssetsRequest request = ExportAssetsRequest.newBuilder().setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()).setReadTime(Timestamp.newBuilder().build()).addAllAssetTypes(new ArrayList<String>()).setContentType(ContentType.forNumber(0)).setOutputConfig(OutputConfig.newBuilder().build()).addAllRelationshipTypes(new ArrayList<String>()).build();
        ApiFuture<Operation> future = assetServiceClient.exportAssetsCallable().futureCall(request);
        // Do something.
        Operation response = future.get();
    }
}
Also used : ExportAssetsRequest(com.google.cloud.asset.v1.ExportAssetsRequest) AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ArrayList(java.util.ArrayList) Operation(com.google.longrunning.Operation)

Example 4 with Feed

use of com.google.cloud.asset.v1.Feed 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 5 with Feed

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

the class SyncGetFeedFeedname method syncGetFeedFeedname.

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

Aggregations

AssetServiceClient (com.google.cloud.asset.v1.AssetServiceClient)24 Feed (com.google.cloud.asset.v1.Feed)13 ArrayList (java.util.ArrayList)6 CreateFeedRequest (com.google.cloud.asset.v1.CreateFeedRequest)3 ExportAssetsRequest (com.google.cloud.asset.v1.ExportAssetsRequest)3 UpdateFeedRequest (com.google.cloud.asset.v1.UpdateFeedRequest)3 Asset (com.google.cloud.asset.v1.Asset)2 DeleteFeedRequest (com.google.cloud.asset.v1.DeleteFeedRequest)2 ExportAssetsResponse (com.google.cloud.asset.v1.ExportAssetsResponse)2 FeedName (com.google.cloud.asset.v1.FeedName)2 GetFeedRequest (com.google.cloud.asset.v1.GetFeedRequest)2 ListAssetsRequest (com.google.cloud.asset.v1.ListAssetsRequest)2 ResourceName (com.google.api.resourcenames.ResourceName)1 ListAssetsPagedResponse (com.google.cloud.asset.v1.AssetServiceClient.ListAssetsPagedResponse)1 BatchGetAssetsHistoryRequest (com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest)1 BatchGetAssetsHistoryResponse (com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse)1 ListAssetsResponse (com.google.cloud.asset.v1.ListAssetsResponse)1 Operation (com.google.longrunning.Operation)1 AbstractMessage (com.google.protobuf.AbstractMessage)1 Empty (com.google.protobuf.Empty)1