Search in sources :

Example 1 with AssetServiceClient

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);
    }
}
Also used : AnalyzeIamPolicyRequest(com.google.cloud.asset.v1.AnalyzeIamPolicyRequest) AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) AnalyzeIamPolicyResponse(com.google.cloud.asset.v1.AnalyzeIamPolicyResponse)

Example 2 with AssetServiceClient

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();
    }
}
Also used : AnalyzeIamPolicyLongrunningRequest(com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest) AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) AnalyzeIamPolicyLongrunningResponse(com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse)

Example 3 with AssetServiceClient

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();
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) AnalyzeMoveRequest(com.google.cloud.asset.v1.AnalyzeMoveRequest) AnalyzeMoveResponse(com.google.cloud.asset.v1.AnalyzeMoveResponse)

Example 4 with AssetServiceClient

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);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) FeedName(com.google.cloud.asset.v1.FeedName)

Example 5 with AssetServiceClient

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);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient)

Aggregations

AssetServiceClient (com.google.cloud.asset.v1.AssetServiceClient)52 Feed (com.google.cloud.asset.v1.Feed)13 ArrayList (java.util.ArrayList)9 IOException (java.io.IOException)6 ApiException (com.google.api.gax.rpc.ApiException)5 AnalyzeIamPolicyLongrunningRequest (com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest)5 ExportAssetsRequest (com.google.cloud.asset.v1.ExportAssetsRequest)5 ExportAssetsResponse (com.google.cloud.asset.v1.ExportAssetsResponse)4 ListFeedsResponse (com.google.cloud.asset.v1.ListFeedsResponse)4 ProjectName (com.google.cloud.asset.v1.ProjectName)4 AnalyzeIamPolicyRequest (com.google.cloud.asset.v1.AnalyzeIamPolicyRequest)3 AnalyzeIamPolicyResponse (com.google.cloud.asset.v1.AnalyzeIamPolicyResponse)3 CreateFeedRequest (com.google.cloud.asset.v1.CreateFeedRequest)3 IamPolicyAnalysisQuery (com.google.cloud.asset.v1.IamPolicyAnalysisQuery)3 Options (com.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options)3 ResourceSelector (com.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector)3 IamPolicySearchResult (com.google.cloud.asset.v1.IamPolicySearchResult)3 ListAssetsRequest (com.google.cloud.asset.v1.ListAssetsRequest)3 ResourceSearchResult (com.google.cloud.asset.v1.ResourceSearchResult)3 SearchAllIamPoliciesRequest (com.google.cloud.asset.v1.SearchAllIamPoliciesRequest)3