use of com.google.cloud.asset.v1.AssetServiceClient 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.AssetServiceClient 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.AssetServiceClient 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);
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncGetFeedString method syncGetFeedString.
public static void syncGetFeedString() throws Exception {
// It may require modifications to work in your environment.
try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
String name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString();
Feed response = assetServiceClient.getFeed(name);
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncAnalyzeMove method syncAnalyzeMove.
public static void syncAnalyzeMove() throws Exception {
// It may require modifications to work in your environment.
try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
AnalyzeMoveRequest request = AnalyzeMoveRequest.newBuilder().setResource("resource-341064690").setDestinationParent("destinationParent-1733659048").build();
AnalyzeMoveResponse response = assetServiceClient.analyzeMove(request);
}
}
Aggregations