use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class AsyncBatchGetAssetsHistory method asyncBatchGetAssetsHistory.
public static void asyncBatchGetAssetsHistory() throws Exception {
// It may require modifications to work in your environment.
try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder().setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()).addAllAssetNames(new ArrayList<String>()).setContentType(ContentType.forNumber(0)).setReadTimeWindow(TimeWindow.newBuilder().build()).addAllRelationshipTypes(new ArrayList<String>()).build();
ApiFuture<BatchGetAssetsHistoryResponse> future = assetServiceClient.batchGetAssetsHistoryCallable().futureCall(request);
// Do something.
BatchGetAssetsHistoryResponse response = future.get();
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateSetCredentialsProvider method syncCreateSetCredentialsProvider.
public static void syncCreateSetCredentialsProvider() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
AssetServiceSettings assetServiceSettings = AssetServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)).build();
AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateSetEndpoint method syncCreateSetEndpoint.
public static void syncCreateSetEndpoint() throws Exception {
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
AssetServiceSettings assetServiceSettings = AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
}
use of com.google.cloud.asset.v1.AssetServiceClient 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.AssetServiceClient 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();
}
}
Aggregations