use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncAnalyzeIamPolicy method syncAnalyzeIamPolicy.
public static void syncAnalyzeIamPolicy() throws Exception {
// It may require modifications to work in your environment.
try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
AnalyzeIamPolicyRequest request = AnalyzeIamPolicyRequest.newBuilder().setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()).setExecutionTimeout(Duration.newBuilder().build()).build();
AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request);
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncAnalyzeIamPolicyLongrunning method syncAnalyzeIamPolicyLongrunning.
public static void syncAnalyzeIamPolicyLongrunning() throws Exception {
// It may require modifications to work in your environment.
try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
AnalyzeIamPolicyLongrunningRequest request = AnalyzeIamPolicyLongrunningRequest.newBuilder().setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()).setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()).build();
AnalyzeIamPolicyLongrunningResponse response = assetServiceClient.analyzeIamPolicyLongrunningAsync(request).get();
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class AsyncAnalyzeMove method asyncAnalyzeMove.
public static void asyncAnalyzeMove() 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();
ApiFuture<AnalyzeMoveResponse> future = assetServiceClient.analyzeMoveCallable().futureCall(request);
// Do something.
AnalyzeMoveResponse response = future.get();
}
}
use of com.google.cloud.asset.v1.AssetServiceClient 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.AssetServiceClient 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);
}
}
Aggregations