@Generated(value="by GAPIC v0.0.5") @BetaApi public class DlpServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
InspectContentResponse response = dlpServiceClient.inspectContent(inspectConfig, items);
}
Note: close() needs to be called on the dlpServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DlpServiceSettings to create(). For example:
To customize credentials:
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DlpServiceClient dlpServiceClient =
DlpServiceClient.create(dlpServiceSettings);
To customize the endpoint:
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder()
.setTransportProvider(DlpServiceSettings.defaultGrpcTransportProviderBuilder()
.setChannelProvider(DlpServiceSettings.defaultGrpcChannelProviderBuilder()
.setEndpoint(myEndpoint)
.build())
.build())
.build();
DlpServiceClient dlpServiceClient =
DlpServiceClient.create(dlpServiceSettings);
| Modifier | Constructor and Description |
|---|---|
protected |
DlpServiceClient(DlpServiceSettings settings)
Constructs an instance of DlpServiceClient, using the given settings.
|
protected |
DlpServiceClient(DlpServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DlpServiceClient |
create()
Constructs an instance of DlpServiceClient with default settings.
|
static DlpServiceClient |
create(DlpServiceSettings settings)
Constructs an instance of DlpServiceClient, using the given settings.
|
static DlpServiceClient |
create(DlpServiceStub stub)
Constructs an instance of DlpServiceClient, using the given stub for making calls.
|
com.google.api.gax.rpc.OperationFuture<com.google.privacy.dlp.v2beta1.InspectOperationResult,com.google.privacy.dlp.v2beta1.InspectOperationMetadata,com.google.longrunning.Operation> |
createInspectOperationAsync(com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest request)
Schedules a job scanning content in a Google Cloud Platform data repository.
|
com.google.api.gax.rpc.OperationFuture<com.google.privacy.dlp.v2beta1.InspectOperationResult,com.google.privacy.dlp.v2beta1.InspectOperationMetadata,com.google.longrunning.Operation> |
createInspectOperationAsync(com.google.privacy.dlp.v2beta1.InspectConfig inspectConfig,
com.google.privacy.dlp.v2beta1.StorageConfig storageConfig,
com.google.privacy.dlp.v2beta1.OutputStorageConfig outputConfig)
Schedules a job scanning content in a Google Cloud Platform data repository.
|
com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest,com.google.longrunning.Operation> |
createInspectOperationCallable()
Schedules a job scanning content in a Google Cloud Platform data repository.
|
com.google.api.gax.rpc.OperationCallable<com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest,com.google.privacy.dlp.v2beta1.InspectOperationResult,com.google.privacy.dlp.v2beta1.InspectOperationMetadata,com.google.longrunning.Operation> |
createInspectOperationOperationCallable()
Schedules a job scanning content in a Google Cloud Platform data repository.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
DlpServiceSettings |
getSettings() |
DlpServiceStub |
getStub() |
com.google.privacy.dlp.v2beta1.InspectContentResponse |
inspectContent(com.google.privacy.dlp.v2beta1.InspectConfig inspectConfig,
List<com.google.privacy.dlp.v2beta1.ContentItem> items)
Finds potentially sensitive info in a list of strings.
|
com.google.privacy.dlp.v2beta1.InspectContentResponse |
inspectContent(com.google.privacy.dlp.v2beta1.InspectContentRequest request)
Finds potentially sensitive info in a list of strings.
|
com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.InspectContentRequest,com.google.privacy.dlp.v2beta1.InspectContentResponse> |
inspectContentCallable()
Finds potentially sensitive info in a list of strings.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
com.google.privacy.dlp.v2beta1.ListInfoTypesResponse |
listInfoTypes(com.google.privacy.dlp.v2beta1.ListInfoTypesRequest request)
Returns sensitive information types for given category.
|
com.google.privacy.dlp.v2beta1.ListInfoTypesResponse |
listInfoTypes(String category,
String languageCode)
Returns sensitive information types for given category.
|
com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.ListInfoTypesRequest,com.google.privacy.dlp.v2beta1.ListInfoTypesResponse> |
listInfoTypesCallable()
Returns sensitive information types for given category.
|
com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse |
listInspectFindings(com.google.privacy.dlp.v2beta1.ListInspectFindingsRequest request)
Returns list of results for given inspect operation result set id.
|
com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse |
listInspectFindings(com.google.privacy.dlp.v2beta1.ResultName name)
Returns list of results for given inspect operation result set id.
|
com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.ListInspectFindingsRequest,com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse> |
listInspectFindingsCallable()
Returns list of results for given inspect operation result set id.
|
com.google.privacy.dlp.v2beta1.ListRootCategoriesResponse |
listRootCategories(String languageCode)
Returns the list of root categories of sensitive information.
|
com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.ListRootCategoriesRequest,com.google.privacy.dlp.v2beta1.ListRootCategoriesResponse> |
listRootCategoriesCallable()
Returns the list of root categories of sensitive information.
|
com.google.privacy.dlp.v2beta1.RedactContentResponse |
redactContent(com.google.privacy.dlp.v2beta1.InspectConfig inspectConfig,
List<com.google.privacy.dlp.v2beta1.ContentItem> items,
List<com.google.privacy.dlp.v2beta1.RedactContentRequest.ReplaceConfig> replaceConfigs)
Redacts potentially sensitive info from a list of strings.
|
com.google.privacy.dlp.v2beta1.RedactContentResponse |
redactContent(com.google.privacy.dlp.v2beta1.RedactContentRequest request)
Redacts potentially sensitive info from a list of strings.
|
com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.RedactContentRequest,com.google.privacy.dlp.v2beta1.RedactContentResponse> |
redactContentCallable()
Redacts potentially sensitive info from a list of strings.
|
void |
shutdown() |
void |
shutdownNow() |
protected DlpServiceClient(DlpServiceSettings settings) throws IOException
IOExceptionprotected DlpServiceClient(DlpServiceStub stub)
public static final DlpServiceClient create() throws IOException
IOExceptionpublic static final DlpServiceClient create(DlpServiceSettings settings) throws IOException
IOExceptionpublic static final DlpServiceClient create(DlpServiceStub stub)
public final DlpServiceSettings getSettings()
@BetaApi public DlpServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final com.google.privacy.dlp.v2beta1.InspectContentResponse inspectContent(com.google.privacy.dlp.v2beta1.InspectConfig inspectConfig,
List<com.google.privacy.dlp.v2beta1.ContentItem> items)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
InspectContentResponse response = dlpServiceClient.inspectContent(inspectConfig, items);
}
inspectConfig - Configuration for the inspector.items - The list of items to inspect. Items in a single request are considered "related"
unless inspect_config.independent_inputs is true. Up to 100 are allowed per request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.privacy.dlp.v2beta1.InspectContentResponse inspectContent(com.google.privacy.dlp.v2beta1.InspectContentRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
InspectContentRequest request = InspectContentRequest.newBuilder()
.setInspectConfig(inspectConfig)
.addAllItems(items)
.build();
InspectContentResponse response = dlpServiceClient.inspectContent(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.InspectContentRequest,com.google.privacy.dlp.v2beta1.InspectContentResponse> inspectContentCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
InspectContentRequest request = InspectContentRequest.newBuilder()
.setInspectConfig(inspectConfig)
.addAllItems(items)
.build();
ApiFuture<InspectContentResponse> future = dlpServiceClient.inspectContentCallable().futureCall(request);
// Do something
InspectContentResponse response = future.get();
}
public final com.google.privacy.dlp.v2beta1.RedactContentResponse redactContent(com.google.privacy.dlp.v2beta1.InspectConfig inspectConfig,
List<com.google.privacy.dlp.v2beta1.ContentItem> items,
List<com.google.privacy.dlp.v2beta1.RedactContentRequest.ReplaceConfig> replaceConfigs)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
String name2 = "EMAIL_ADDRESS";
InfoType infoType = InfoType.newBuilder()
.setName(name2)
.build();
String replaceWith = "REDACTED";
RedactContentRequest.ReplaceConfig replaceConfigsElement = RedactContentRequest.ReplaceConfig.newBuilder()
.setInfoType(infoType)
.setReplaceWith(replaceWith)
.build();
List<RedactContentRequest.ReplaceConfig> replaceConfigs = Arrays.asList(replaceConfigsElement);
RedactContentResponse response = dlpServiceClient.redactContent(inspectConfig, items, replaceConfigs);
}
inspectConfig - Configuration for the inspector.items - The list of items to inspect. Up to 100 are allowed per request.replaceConfigs - The strings to replace findings text findings with. Must specify at least
one of these or one ImageRedactionConfig if redacting images.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.privacy.dlp.v2beta1.RedactContentResponse redactContent(com.google.privacy.dlp.v2beta1.RedactContentRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
String name2 = "EMAIL_ADDRESS";
InfoType infoType = InfoType.newBuilder()
.setName(name2)
.build();
String replaceWith = "REDACTED";
RedactContentRequest.ReplaceConfig replaceConfigsElement = RedactContentRequest.ReplaceConfig.newBuilder()
.setInfoType(infoType)
.setReplaceWith(replaceWith)
.build();
List<RedactContentRequest.ReplaceConfig> replaceConfigs = Arrays.asList(replaceConfigsElement);
RedactContentRequest request = RedactContentRequest.newBuilder()
.setInspectConfig(inspectConfig)
.addAllItems(items)
.addAllReplaceConfigs(replaceConfigs)
.build();
RedactContentResponse response = dlpServiceClient.redactContent(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.RedactContentRequest,com.google.privacy.dlp.v2beta1.RedactContentResponse> redactContentCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String type = "text/plain";
String value = "My email is example @example.com.";
ContentItem itemsElement = ContentItem.newBuilder()
.setType(type)
.setValue(value)
.build();
List<ContentItem> items = Arrays.asList(itemsElement);
String name2 = "EMAIL_ADDRESS";
InfoType infoType = InfoType.newBuilder()
.setName(name2)
.build();
String replaceWith = "REDACTED";
RedactContentRequest.ReplaceConfig replaceConfigsElement = RedactContentRequest.ReplaceConfig.newBuilder()
.setInfoType(infoType)
.setReplaceWith(replaceWith)
.build();
List<RedactContentRequest.ReplaceConfig> replaceConfigs = Arrays.asList(replaceConfigsElement);
RedactContentRequest request = RedactContentRequest.newBuilder()
.setInspectConfig(inspectConfig)
.addAllItems(items)
.addAllReplaceConfigs(replaceConfigs)
.build();
ApiFuture<RedactContentResponse> future = dlpServiceClient.redactContentCallable().futureCall(request);
// Do something
RedactContentResponse response = future.get();
}
public final com.google.api.gax.rpc.OperationFuture<com.google.privacy.dlp.v2beta1.InspectOperationResult,com.google.privacy.dlp.v2beta1.InspectOperationMetadata,com.google.longrunning.Operation> createInspectOperationAsync(com.google.privacy.dlp.v2beta1.InspectConfig inspectConfig,
com.google.privacy.dlp.v2beta1.StorageConfig storageConfig,
com.google.privacy.dlp.v2beta1.OutputStorageConfig outputConfig)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String url = "gs://example_bucket/example_file.png";
CloudStorageOptions.FileSet fileSet = CloudStorageOptions.FileSet.newBuilder()
.setUrl(url)
.build();
CloudStorageOptions cloudStorageOptions = CloudStorageOptions.newBuilder()
.setFileSet(fileSet)
.build();
StorageConfig storageConfig = StorageConfig.newBuilder()
.setCloudStorageOptions(cloudStorageOptions)
.build();
OutputStorageConfig outputConfig = OutputStorageConfig.newBuilder().build();
InspectOperationResult response = dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig).get();
}
inspectConfig - Configuration for the inspector.storageConfig - Specification of the data set to process.outputConfig - Optional location to store findings. The bucket must already exist and the
Google APIs service account for DLP must have write permission to write to the given
bucket. <p>Results are split over multiple csv files with each file name matching the
pattern "[operation_id]_[count].csv", for example `3094877188788974909_1.csv`. The
`operation_id` matches the identifier for the Operation, and the `count` is a counter used
for tracking the number of files written. <p>The CSV file(s) contain the following
columns regardless of storage type scanned: <li>id <li>info_type
<li>likelihood <li>byte size of finding <li>quote
<li>timestamp<br/> <p>For Cloud Storage the next columns are:
<li>file_path <li>start_offset<br/> <p>For Cloud Datastore the next
columns are: <li>project_id <li>namespace_id <li>path
<li>column_name <li>offset<br/> <p>For BigQuery the next columns
are: <li>row_number <li>project_id <li>dataset_id <li>table_idcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationFuture<com.google.privacy.dlp.v2beta1.InspectOperationResult,com.google.privacy.dlp.v2beta1.InspectOperationMetadata,com.google.longrunning.Operation> createInspectOperationAsync(com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String url = "gs://example_bucket/example_file.png";
CloudStorageOptions.FileSet fileSet = CloudStorageOptions.FileSet.newBuilder()
.setUrl(url)
.build();
CloudStorageOptions cloudStorageOptions = CloudStorageOptions.newBuilder()
.setFileSet(fileSet)
.build();
StorageConfig storageConfig = StorageConfig.newBuilder()
.setCloudStorageOptions(cloudStorageOptions)
.build();
OutputStorageConfig outputConfig = OutputStorageConfig.newBuilder().build();
CreateInspectOperationRequest request = CreateInspectOperationRequest.newBuilder()
.setInspectConfig(inspectConfig)
.setStorageConfig(storageConfig)
.setOutputConfig(outputConfig)
.build();
InspectOperationResult response = dlpServiceClient.createInspectOperationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest,com.google.privacy.dlp.v2beta1.InspectOperationResult,com.google.privacy.dlp.v2beta1.InspectOperationMetadata,com.google.longrunning.Operation> createInspectOperationOperationCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String url = "gs://example_bucket/example_file.png";
CloudStorageOptions.FileSet fileSet = CloudStorageOptions.FileSet.newBuilder()
.setUrl(url)
.build();
CloudStorageOptions cloudStorageOptions = CloudStorageOptions.newBuilder()
.setFileSet(fileSet)
.build();
StorageConfig storageConfig = StorageConfig.newBuilder()
.setCloudStorageOptions(cloudStorageOptions)
.build();
OutputStorageConfig outputConfig = OutputStorageConfig.newBuilder().build();
CreateInspectOperationRequest request = CreateInspectOperationRequest.newBuilder()
.setInspectConfig(inspectConfig)
.setStorageConfig(storageConfig)
.setOutputConfig(outputConfig)
.build();
OperationFuture<Operation> future = dlpServiceClient.createInspectOperationOperationCallable().futureCall(request);
// Do something
InspectOperationResult response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest,com.google.longrunning.Operation> createInspectOperationCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String name = "EMAIL_ADDRESS";
InfoType infoTypesElement = InfoType.newBuilder()
.setName(name)
.build();
List<InfoType> infoTypes = Arrays.asList(infoTypesElement);
InspectConfig inspectConfig = InspectConfig.newBuilder()
.addAllInfoTypes(infoTypes)
.build();
String url = "gs://example_bucket/example_file.png";
CloudStorageOptions.FileSet fileSet = CloudStorageOptions.FileSet.newBuilder()
.setUrl(url)
.build();
CloudStorageOptions cloudStorageOptions = CloudStorageOptions.newBuilder()
.setFileSet(fileSet)
.build();
StorageConfig storageConfig = StorageConfig.newBuilder()
.setCloudStorageOptions(cloudStorageOptions)
.build();
OutputStorageConfig outputConfig = OutputStorageConfig.newBuilder().build();
CreateInspectOperationRequest request = CreateInspectOperationRequest.newBuilder()
.setInspectConfig(inspectConfig)
.setStorageConfig(storageConfig)
.setOutputConfig(outputConfig)
.build();
ApiFuture<Operation> future = dlpServiceClient.createInspectOperationCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse listInspectFindings(com.google.privacy.dlp.v2beta1.ResultName name)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ResultName name = ResultName.create("[RESULT]");
ListInspectFindingsResponse response = dlpServiceClient.listInspectFindings(name);
}
name - Identifier of the results set returned as metadata of the longrunning operation
created by a call to CreateInspectOperation. Should be in the format of
`inspect/results/{id}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse listInspectFindings(com.google.privacy.dlp.v2beta1.ListInspectFindingsRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ResultName name = ResultName.create("[RESULT]");
ListInspectFindingsRequest request = ListInspectFindingsRequest.newBuilder()
.setNameWithResultName(name)
.build();
ListInspectFindingsResponse response = dlpServiceClient.listInspectFindings(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.ListInspectFindingsRequest,com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse> listInspectFindingsCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ResultName name = ResultName.create("[RESULT]");
ListInspectFindingsRequest request = ListInspectFindingsRequest.newBuilder()
.setNameWithResultName(name)
.build();
ApiFuture<ListInspectFindingsResponse> future = dlpServiceClient.listInspectFindingsCallable().futureCall(request);
// Do something
ListInspectFindingsResponse response = future.get();
}
public final com.google.privacy.dlp.v2beta1.ListInfoTypesResponse listInfoTypes(String category, String languageCode)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String category = "PII";
String languageCode = "en";
ListInfoTypesResponse response = dlpServiceClient.listInfoTypes(category, languageCode);
}
category - Category name as returned by ListRootCategories.languageCode - Optional BCP-47 language code for localized info type friendly names. If
omitted, or if localized strings are not available, en-US strings will be returned.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.privacy.dlp.v2beta1.ListInfoTypesResponse listInfoTypes(com.google.privacy.dlp.v2beta1.ListInfoTypesRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String category = "PII";
String languageCode = "en";
ListInfoTypesRequest request = ListInfoTypesRequest.newBuilder()
.setCategory(category)
.setLanguageCode(languageCode)
.build();
ListInfoTypesResponse response = dlpServiceClient.listInfoTypes(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.ListInfoTypesRequest,com.google.privacy.dlp.v2beta1.ListInfoTypesResponse> listInfoTypesCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String category = "PII";
String languageCode = "en";
ListInfoTypesRequest request = ListInfoTypesRequest.newBuilder()
.setCategory(category)
.setLanguageCode(languageCode)
.build();
ApiFuture<ListInfoTypesResponse> future = dlpServiceClient.listInfoTypesCallable().futureCall(request);
// Do something
ListInfoTypesResponse response = future.get();
}
public final com.google.privacy.dlp.v2beta1.ListRootCategoriesResponse listRootCategories(String languageCode)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String languageCode = "en";
ListRootCategoriesResponse response = dlpServiceClient.listRootCategories(languageCode);
}
languageCode - Optional language code for localized friendly category names. If omitted or
if localized strings are not available, en-US strings will be returned.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.privacy.dlp.v2beta1.ListRootCategoriesRequest,com.google.privacy.dlp.v2beta1.ListRootCategoriesResponse> listRootCategoriesCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String languageCode = "en";
ListRootCategoriesRequest request = ListRootCategoriesRequest.newBuilder()
.setLanguageCode(languageCode)
.build();
ApiFuture<ListRootCategoriesResponse> future = dlpServiceClient.listRootCategoriesCallable().futureCall(request);
// Do something
ListRootCategoriesResponse response = future.get();
}
public final void close()
throws Exception
close in interface AutoCloseableExceptionpublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2017 Google. All rights reserved.