use of com.google.cloud.securitycenter.v1.UpdateBigQueryExportRequest in project java-securitycenter by googleapis.
the class UpdateBigQueryExport method updateBigQueryExport.
// Updates an existing BigQuery export.
public static void updateBigQueryExport(String parent, String filter, String bigQueryExportId) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (SecurityCenterClient client = SecurityCenterClient.create()) {
// Set the new values for export configuration.
BigQueryExport bigQueryExport = BigQueryExport.newBuilder().setName(String.format("%s/bigQueryExports/%s", parent, bigQueryExportId)).setFilter(filter).build();
UpdateBigQueryExportRequest request = UpdateBigQueryExportRequest.newBuilder().setBigQueryExport(bigQueryExport).setUpdateMask(FieldMask.newBuilder().addPaths("filter").build()).build();
BigQueryExport response = client.updateBigQueryExport(request);
if (!response.getFilter().equalsIgnoreCase(filter)) {
System.out.println("Failed to update BigQueryExport!");
return;
}
System.out.println("BigQueryExport updated successfully!");
}
}
Aggregations