Search in sources :

Example 31 with AssetServiceClient

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

Example 32 with AssetServiceClient

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

Example 33 with AssetServiceClient

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

Example 34 with AssetServiceClient

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

Example 35 with AssetServiceClient

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

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