use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class AsyncSearchAllIamPoliciesPaged method asyncSearchAllIamPoliciesPaged.
public static void asyncSearchAllIamPoliciesPaged() 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();
while (true) {
SearchAllIamPoliciesResponse response = assetServiceClient.searchAllIamPoliciesCallable().call(request);
for (IamPolicySearchResult element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class AsyncExportAssetsLRO method asyncExportAssetsLRO.
public static void asyncExportAssetsLRO() 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();
OperationFuture<ExportAssetsResponse, ExportAssetsRequest> future = assetServiceClient.exportAssetsOperationCallable().futureCall(request);
// Do something.
ExportAssetsResponse response = future.get();
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncExportAssets method syncExportAssets.
public static void syncExportAssets() 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();
ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class SyncGetFeed method syncGetFeed.
public static void syncGetFeed() 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();
Feed response = assetServiceClient.getFeed(request);
}
}
use of com.google.cloud.asset.v1.AssetServiceClient in project gapic-generator-java by googleapis.
the class AsyncListAssets method asyncListAssets.
public static void asyncListAssets() throws Exception {
// It may require modifications to work in your environment.
try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()).setReadTime(Timestamp.newBuilder().build()).addAllAssetTypes(new ArrayList<String>()).setContentType(ContentType.forNumber(0)).setPageSize(883849137).setPageToken("pageToken873572522").addAllRelationshipTypes(new ArrayList<String>()).build();
ApiFuture<Asset> future = assetServiceClient.listAssetsPagedCallable().futureCall(request);
// Do something.
for (Asset element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
Aggregations