Search in sources :

Example 36 with AssetServiceClient

use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.

the class SyncDeleteFeed method syncDeleteFeed.

public static void syncDeleteFeed() 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();
        assetServiceClient.deleteFeed(request);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) DeleteFeedRequest(com.google.cloud.asset.v1.DeleteFeedRequest)

Example 37 with AssetServiceClient

use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.

the class AsyncListFeeds method asyncListFeeds.

public static void asyncListFeeds() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        ListFeedsRequest request = ListFeedsRequest.newBuilder().setParent("parent-995424086").build();
        ApiFuture<ListFeedsResponse> future = assetServiceClient.listFeedsCallable().futureCall(request);
        // Do something.
        ListFeedsResponse response = future.get();
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsRequest(com.google.cloud.asset.v1.ListFeedsRequest) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Example 38 with AssetServiceClient

use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.

the class SyncListFeeds method syncListFeeds.

public static void syncListFeeds() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        ListFeedsRequest request = ListFeedsRequest.newBuilder().setParent("parent-995424086").build();
        ListFeedsResponse response = assetServiceClient.listFeeds(request);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsRequest(com.google.cloud.asset.v1.ListFeedsRequest) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Example 39 with AssetServiceClient

use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.

the class SyncListFeedsString method syncListFeedsString.

public static void syncListFeedsString() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        String parent = "parent-995424086";
        ListFeedsResponse response = assetServiceClient.listFeeds(parent);
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) ListFeedsResponse(com.google.cloud.asset.v1.ListFeedsResponse)

Example 40 with AssetServiceClient

use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.

the class AsyncSearchAllIamPolicies method asyncSearchAllIamPolicies.

public static void asyncSearchAllIamPolicies() throws Exception {
    // It may require modifications to work in your environment.
    try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
        SearchAllIamPoliciesRequest request = SearchAllIamPoliciesRequest.newBuilder().setScope("scope109264468").setQuery("query107944136").setPageSize(883849137).setPageToken("pageToken873572522").addAllAssetTypes(new ArrayList<String>()).setOrderBy("orderBy-1207110587").build();
        ApiFuture<IamPolicySearchResult> future = assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request);
        // Do something.
        for (IamPolicySearchResult element : future.get().iterateAll()) {
        // doThingsWith(element);
        }
    }
}
Also used : AssetServiceClient(com.google.cloud.asset.v1.AssetServiceClient) SearchAllIamPoliciesRequest(com.google.cloud.asset.v1.SearchAllIamPoliciesRequest) IamPolicySearchResult(com.google.cloud.asset.v1.IamPolicySearchResult)

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