Search in sources :

Example 16 with Feed

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

the class SyncCreateFeedString method syncCreateFeedString.

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

Example 17 with Feed

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

the class AsyncDeleteFeed method asyncDeleteFeed.

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

Example 18 with Feed

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

the class SyncDeleteFeed method syncDeleteFeed.

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

Example 19 with Feed

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

the class AsyncExportAssetsLRO method asyncExportAssetsLRO.

public static void asyncExportAssetsLRO() 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();
        OperationFuture<ExportAssetsResponse, ExportAssetsRequest> future = assetServiceClient.exportAssetsOperationCallable().futureCall(request);
        // Do something.
        ExportAssetsResponse response = future.get();
    }
}
Also used : ExportAssetsRequest(com.google.cloud.asset.v1.ExportAssetsRequest) AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ArrayList(java.util.ArrayList) ExportAssetsResponse(com.google.cloud.asset.v1.ExportAssetsResponse)

Example 20 with Feed

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

the class SyncExportAssets method syncExportAssets.

public static void syncExportAssets() 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();
        ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
    }
}
Also used : ExportAssetsRequest(com.google.cloud.asset.v1.ExportAssetsRequest) AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ArrayList(java.util.ArrayList) ExportAssetsResponse(com.google.cloud.asset.v1.ExportAssetsResponse)

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