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);
}
}
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);
}
}
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();
}
}
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();
}
}
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);
}
}
Aggregations