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