Search in sources :

Example 6 with AssetServiceClient

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();
    }
}
Also used : ExportAssetsRequest(com.google.cloud.asset.v1.ExportAssetsRequest) AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ArrayList(java.util.ArrayList) Operation(com.google.longrunning.Operation)

Example 7 with AssetServiceClient

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

Example 8 with AssetServiceClient

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

Example 9 with AssetServiceClient

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

Example 10 with AssetServiceClient

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

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