Class DlpServiceClient (3.21.0)

public class DlpServiceClient implements BackgroundResource

Service Description: The Cloud Data Loss Prevention (DLP) API is a service that allows clients to detect the presence of Personally Identifiable Information (PII) and other privacy-sensitive data in user-supplied, unstructured data streams, like text blocks or images. The service also includes methods for sensitive data redaction and scheduling of data scans on Google Cloud Platform based data sets.

To learn more about concepts and find how-to guides see https://cloud.google.com/dlp/docs/.

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   InspectContentRequest request =
       InspectContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setLocationId("locationId1541836720")
           .build();
   InspectContentResponse response = dlpServiceClient.inspectContent(request);
 }
 

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:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DlpServiceSettings dlpServiceSettings =
     DlpServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DlpServiceSettings dlpServiceSettings =
     DlpServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DlpServiceSettings dlpServiceSettings = DlpServiceSettings.newHttpJsonBuilder().build();
 DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > DlpServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final DlpServiceClient create()

Constructs an instance of DlpServiceClient with default settings.

Returns
TypeDescription
DlpServiceClient
Exceptions
TypeDescription
IOException

create(DlpServiceSettings settings)

public static final DlpServiceClient create(DlpServiceSettings settings)

Constructs an instance of DlpServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsDlpServiceSettings
Returns
TypeDescription
DlpServiceClient
Exceptions
TypeDescription
IOException

create(DlpServiceStub stub)

public static final DlpServiceClient create(DlpServiceStub stub)

Constructs an instance of DlpServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DlpServiceSettings).

Parameter
NameDescription
stubDlpServiceStub
Returns
TypeDescription
DlpServiceClient

Constructors

DlpServiceClient(DlpServiceSettings settings)

protected DlpServiceClient(DlpServiceSettings settings)

Constructs an instance of DlpServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsDlpServiceSettings

DlpServiceClient(DlpServiceStub stub)

protected DlpServiceClient(DlpServiceStub stub)
Parameter
NameDescription
stubDlpServiceStub

Methods

activateJobTrigger(ActivateJobTriggerRequest request)

public final DlpJob activateJobTrigger(ActivateJobTriggerRequest request)

Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ActivateJobTriggerRequest request =
       ActivateJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .build();
   DlpJob response = dlpServiceClient.activateJobTrigger(request);
 }
 
Parameter
NameDescription
requestActivateJobTriggerRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpJob

activateJobTriggerCallable()

public final UnaryCallable<ActivateJobTriggerRequest,DlpJob> activateJobTriggerCallable()

Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ActivateJobTriggerRequest request =
       ActivateJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .build();
   ApiFuture<DlpJob> future = dlpServiceClient.activateJobTriggerCallable().futureCall(request);
   // Do something.
   DlpJob response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ActivateJobTriggerRequest,DlpJob>

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

cancelDlpJob(CancelDlpJobRequest request)

public final void cancelDlpJob(CancelDlpJobRequest request)

Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CancelDlpJobRequest request =
       CancelDlpJobRequest.newBuilder()
           .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
           .build();
   dlpServiceClient.cancelDlpJob(request);
 }
 
Parameter
NameDescription
requestCancelDlpJobRequest

The request object containing all of the parameters for the API call.

cancelDlpJobCallable()

public final UnaryCallable<CancelDlpJobRequest,Empty> cancelDlpJobCallable()

Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CancelDlpJobRequest request =
       CancelDlpJobRequest.newBuilder()
           .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
           .build();
   ApiFuture<Empty> future = dlpServiceClient.cancelDlpJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CancelDlpJobRequest,Empty>

close()

public final void close()

createDeidentifyTemplate(CreateDeidentifyTemplateRequest request)

public final DeidentifyTemplate createDeidentifyTemplate(CreateDeidentifyTemplateRequest request)

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateDeidentifyTemplateRequest request =
       CreateDeidentifyTemplateRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setDeidentifyTemplate(DeidentifyTemplate.newBuilder().build())
           .setTemplateId("templateId1304010549")
           .setLocationId("locationId1541836720")
           .build();
   DeidentifyTemplate response = dlpServiceClient.createDeidentifyTemplate(request);
 }
 
Parameter
NameDescription
requestCreateDeidentifyTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DeidentifyTemplate

createDeidentifyTemplate(LocationName parent, DeidentifyTemplate deidentifyTemplate)

public final DeidentifyTemplate createDeidentifyTemplate(LocationName parent, DeidentifyTemplate deidentifyTemplate)

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
 }
 
Parameters
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

deidentifyTemplateDeidentifyTemplate

Required. The DeidentifyTemplate to create.

Returns
TypeDescription
DeidentifyTemplate

createDeidentifyTemplate(OrganizationLocationName parent, DeidentifyTemplate deidentifyTemplate)

public final DeidentifyTemplate createDeidentifyTemplate(OrganizationLocationName parent, DeidentifyTemplate deidentifyTemplate)

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
 }
 
Parameters
NameDescription
parentOrganizationLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

deidentifyTemplateDeidentifyTemplate

Required. The DeidentifyTemplate to create.

Returns
TypeDescription
DeidentifyTemplate

createDeidentifyTemplate(OrganizationName parent, DeidentifyTemplate deidentifyTemplate)

public final DeidentifyTemplate createDeidentifyTemplate(OrganizationName parent, DeidentifyTemplate deidentifyTemplate)

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
 }
 
Parameters
NameDescription
parentOrganizationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

deidentifyTemplateDeidentifyTemplate

Required. The DeidentifyTemplate to create.

Returns
TypeDescription
DeidentifyTemplate

createDeidentifyTemplate(ProjectName parent, DeidentifyTemplate deidentifyTemplate)

public final DeidentifyTemplate createDeidentifyTemplate(ProjectName parent, DeidentifyTemplate deidentifyTemplate)

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
 }
 
Parameters
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

deidentifyTemplateDeidentifyTemplate

Required. The DeidentifyTemplate to create.

Returns
TypeDescription
DeidentifyTemplate

createDeidentifyTemplate(String parent, DeidentifyTemplate deidentifyTemplate)

public final DeidentifyTemplate createDeidentifyTemplate(String parent, DeidentifyTemplate deidentifyTemplate)

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

deidentifyTemplateDeidentifyTemplate

Required. The DeidentifyTemplate to create.

Returns
TypeDescription
DeidentifyTemplate

createDeidentifyTemplateCallable()

public final UnaryCallable<CreateDeidentifyTemplateRequest,DeidentifyTemplate> createDeidentifyTemplateCallable()

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateDeidentifyTemplateRequest request =
       CreateDeidentifyTemplateRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setDeidentifyTemplate(DeidentifyTemplate.newBuilder().build())
           .setTemplateId("templateId1304010549")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<DeidentifyTemplate> future =
       dlpServiceClient.createDeidentifyTemplateCallable().futureCall(request);
   // Do something.
   DeidentifyTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateDeidentifyTemplateRequest,DeidentifyTemplate>

createDlpJob(CreateDlpJobRequest request)

public final DlpJob createDlpJob(CreateDlpJobRequest request)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateDlpJobRequest request =
       CreateDlpJobRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setJobId("jobId101296568")
           .setLocationId("locationId1541836720")
           .build();
   DlpJob response = dlpServiceClient.createDlpJob(request);
 }
 
Parameter
NameDescription
requestCreateDlpJobRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpJob

createDlpJob(LocationName parent, InspectJobConfig inspectJob)

public final DlpJob createDlpJob(LocationName parent, InspectJobConfig inspectJob)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
   DlpJob response = dlpServiceClient.createDlpJob(parent, inspectJob);
 }
 
Parameters
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectJobInspectJobConfig

An inspection job scans a storage repository for InfoTypes.

Returns
TypeDescription
DlpJob

createDlpJob(LocationName parent, RiskAnalysisJobConfig riskJob)

public final DlpJob createDlpJob(LocationName parent, RiskAnalysisJobConfig riskJob)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
   DlpJob response = dlpServiceClient.createDlpJob(parent, riskJob);
 }
 
Parameters
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

riskJobRiskAnalysisJobConfig

A risk analysis job calculates re-identification risk metrics for a BigQuery table.

Returns
TypeDescription
DlpJob

createDlpJob(ProjectName parent, InspectJobConfig inspectJob)

public final DlpJob createDlpJob(ProjectName parent, InspectJobConfig inspectJob)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
   DlpJob response = dlpServiceClient.createDlpJob(parent, inspectJob);
 }
 
Parameters
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectJobInspectJobConfig

An inspection job scans a storage repository for InfoTypes.

Returns
TypeDescription
DlpJob

createDlpJob(ProjectName parent, RiskAnalysisJobConfig riskJob)

public final DlpJob createDlpJob(ProjectName parent, RiskAnalysisJobConfig riskJob)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
   DlpJob response = dlpServiceClient.createDlpJob(parent, riskJob);
 }
 
Parameters
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

riskJobRiskAnalysisJobConfig

A risk analysis job calculates re-identification risk metrics for a BigQuery table.

Returns
TypeDescription
DlpJob

createDlpJob(String parent, InspectJobConfig inspectJob)

public final DlpJob createDlpJob(String parent, InspectJobConfig inspectJob)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
   DlpJob response = dlpServiceClient.createDlpJob(parent, inspectJob);
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectJobInspectJobConfig

An inspection job scans a storage repository for InfoTypes.

Returns
TypeDescription
DlpJob

createDlpJob(String parent, RiskAnalysisJobConfig riskJob)

public final DlpJob createDlpJob(String parent, RiskAnalysisJobConfig riskJob)

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
   DlpJob response = dlpServiceClient.createDlpJob(parent, riskJob);
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

riskJobRiskAnalysisJobConfig

A risk analysis job calculates re-identification risk metrics for a BigQuery table.

Returns
TypeDescription
DlpJob

createDlpJobCallable()

public final UnaryCallable<CreateDlpJobRequest,DlpJob> createDlpJobCallable()

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateDlpJobRequest request =
       CreateDlpJobRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setJobId("jobId101296568")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<DlpJob> future = dlpServiceClient.createDlpJobCallable().futureCall(request);
   // Do something.
   DlpJob response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateDlpJobRequest,DlpJob>

createInspectTemplate(CreateInspectTemplateRequest request)

public final InspectTemplate createInspectTemplate(CreateInspectTemplateRequest request)

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateInspectTemplateRequest request =
       CreateInspectTemplateRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setInspectTemplate(InspectTemplate.newBuilder().build())
           .setTemplateId("templateId1304010549")
           .setLocationId("locationId1541836720")
           .build();
   InspectTemplate response = dlpServiceClient.createInspectTemplate(request);
 }
 
Parameter
NameDescription
requestCreateInspectTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
InspectTemplate

createInspectTemplate(LocationName parent, InspectTemplate inspectTemplate)

public final InspectTemplate createInspectTemplate(LocationName parent, InspectTemplate inspectTemplate)

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
 }
 
Parameters
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectTemplateInspectTemplate

Required. The InspectTemplate to create.

Returns
TypeDescription
InspectTemplate

createInspectTemplate(OrganizationLocationName parent, InspectTemplate inspectTemplate)

public final InspectTemplate createInspectTemplate(OrganizationLocationName parent, InspectTemplate inspectTemplate)

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
 }
 
Parameters
NameDescription
parentOrganizationLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectTemplateInspectTemplate

Required. The InspectTemplate to create.

Returns
TypeDescription
InspectTemplate

createInspectTemplate(OrganizationName parent, InspectTemplate inspectTemplate)

public final InspectTemplate createInspectTemplate(OrganizationName parent, InspectTemplate inspectTemplate)

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
 }
 
Parameters
NameDescription
parentOrganizationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectTemplateInspectTemplate

Required. The InspectTemplate to create.

Returns
TypeDescription
InspectTemplate

createInspectTemplate(ProjectName parent, InspectTemplate inspectTemplate)

public final InspectTemplate createInspectTemplate(ProjectName parent, InspectTemplate inspectTemplate)

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
 }
 
Parameters
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectTemplateInspectTemplate

Required. The InspectTemplate to create.

Returns
TypeDescription
InspectTemplate

createInspectTemplate(String parent, InspectTemplate inspectTemplate)

public final InspectTemplate createInspectTemplate(String parent, InspectTemplate inspectTemplate)

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

inspectTemplateInspectTemplate

Required. The InspectTemplate to create.

Returns
TypeDescription
InspectTemplate

createInspectTemplateCallable()

public final UnaryCallable<CreateInspectTemplateRequest,InspectTemplate> createInspectTemplateCallable()

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateInspectTemplateRequest request =
       CreateInspectTemplateRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setInspectTemplate(InspectTemplate.newBuilder().build())
           .setTemplateId("templateId1304010549")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<InspectTemplate> future =
       dlpServiceClient.createInspectTemplateCallable().futureCall(request);
   // Do something.
   InspectTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateInspectTemplateRequest,InspectTemplate>

createJobTrigger(CreateJobTriggerRequest request)

public final JobTrigger createJobTrigger(CreateJobTriggerRequest request)

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateJobTriggerRequest request =
       CreateJobTriggerRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setJobTrigger(JobTrigger.newBuilder().build())
           .setTriggerId("triggerId-648752909")
           .setLocationId("locationId1541836720")
           .build();
   JobTrigger response = dlpServiceClient.createJobTrigger(request);
 }
 
Parameter
NameDescription
requestCreateJobTriggerRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
JobTrigger

createJobTrigger(LocationName parent, JobTrigger jobTrigger)

public final JobTrigger createJobTrigger(LocationName parent, JobTrigger jobTrigger)

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   JobTrigger jobTrigger = JobTrigger.newBuilder().build();
   JobTrigger response = dlpServiceClient.createJobTrigger(parent, jobTrigger);
 }
 
Parameters
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

jobTriggerJobTrigger

Required. The JobTrigger to create.

Returns
TypeDescription
JobTrigger

createJobTrigger(ProjectName parent, JobTrigger jobTrigger)

public final JobTrigger createJobTrigger(ProjectName parent, JobTrigger jobTrigger)

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   JobTrigger jobTrigger = JobTrigger.newBuilder().build();
   JobTrigger response = dlpServiceClient.createJobTrigger(parent, jobTrigger);
 }
 
Parameters
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

jobTriggerJobTrigger

Required. The JobTrigger to create.

Returns
TypeDescription
JobTrigger

createJobTrigger(String parent, JobTrigger jobTrigger)

public final JobTrigger createJobTrigger(String parent, JobTrigger jobTrigger)

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   JobTrigger jobTrigger = JobTrigger.newBuilder().build();
   JobTrigger response = dlpServiceClient.createJobTrigger(parent, jobTrigger);
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

jobTriggerJobTrigger

Required. The JobTrigger to create.

Returns
TypeDescription
JobTrigger

createJobTriggerCallable()

public final UnaryCallable<CreateJobTriggerRequest,JobTrigger> createJobTriggerCallable()

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateJobTriggerRequest request =
       CreateJobTriggerRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setJobTrigger(JobTrigger.newBuilder().build())
           .setTriggerId("triggerId-648752909")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<JobTrigger> future =
       dlpServiceClient.createJobTriggerCallable().futureCall(request);
   // Do something.
   JobTrigger response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateJobTriggerRequest,JobTrigger>

createStoredInfoType(CreateStoredInfoTypeRequest request)

public final StoredInfoType createStoredInfoType(CreateStoredInfoTypeRequest request)

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateStoredInfoTypeRequest request =
       CreateStoredInfoTypeRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setConfig(StoredInfoTypeConfig.newBuilder().build())
           .setStoredInfoTypeId("storedInfoTypeId-1409591226")
           .setLocationId("locationId1541836720")
           .build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(request);
 }
 
Parameter
NameDescription
requestCreateStoredInfoTypeRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
StoredInfoType

createStoredInfoType(LocationName parent, StoredInfoTypeConfig config)

public final StoredInfoType createStoredInfoType(LocationName parent, StoredInfoTypeConfig config)

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
 }
 
Parameters
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

configStoredInfoTypeConfig

Required. Configuration of the storedInfoType to create.

Returns
TypeDescription
StoredInfoType

createStoredInfoType(OrganizationLocationName parent, StoredInfoTypeConfig config)

public final StoredInfoType createStoredInfoType(OrganizationLocationName parent, StoredInfoTypeConfig config)

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
 }
 
Parameters
NameDescription
parentOrganizationLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

configStoredInfoTypeConfig

Required. Configuration of the storedInfoType to create.

Returns
TypeDescription
StoredInfoType

createStoredInfoType(OrganizationName parent, StoredInfoTypeConfig config)

public final StoredInfoType createStoredInfoType(OrganizationName parent, StoredInfoTypeConfig config)

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
 }
 
Parameters
NameDescription
parentOrganizationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

configStoredInfoTypeConfig

Required. Configuration of the storedInfoType to create.

Returns
TypeDescription
StoredInfoType

createStoredInfoType(ProjectName parent, StoredInfoTypeConfig config)

public final StoredInfoType createStoredInfoType(ProjectName parent, StoredInfoTypeConfig config)

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
 }
 
Parameters
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

configStoredInfoTypeConfig

Required. Configuration of the storedInfoType to create.

Returns
TypeDescription
StoredInfoType

createStoredInfoType(String parent, StoredInfoTypeConfig config)

public final StoredInfoType createStoredInfoType(String parent, StoredInfoTypeConfig config)

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
 }
 
Parameters
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

configStoredInfoTypeConfig

Required. Configuration of the storedInfoType to create.

Returns
TypeDescription
StoredInfoType

createStoredInfoTypeCallable()

public final UnaryCallable<CreateStoredInfoTypeRequest,StoredInfoType> createStoredInfoTypeCallable()

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   CreateStoredInfoTypeRequest request =
       CreateStoredInfoTypeRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setConfig(StoredInfoTypeConfig.newBuilder().build())
           .setStoredInfoTypeId("storedInfoTypeId-1409591226")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<StoredInfoType> future =
       dlpServiceClient.createStoredInfoTypeCallable().futureCall(request);
   // Do something.
   StoredInfoType response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateStoredInfoTypeRequest,StoredInfoType>

deidentifyContent(DeidentifyContentRequest request)

public final DeidentifyContentResponse deidentifyContent(DeidentifyContentRequest request)

De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to learn more.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeidentifyContentRequest request =
       DeidentifyContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setDeidentifyConfig(DeidentifyConfig.newBuilder().build())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setDeidentifyTemplateName("deidentifyTemplateName-1374666414")
           .setLocationId("locationId1541836720")
           .build();
   DeidentifyContentResponse response = dlpServiceClient.deidentifyContent(request);
 }
 
Parameter
NameDescription
requestDeidentifyContentRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DeidentifyContentResponse

deidentifyContentCallable()

public final UnaryCallable<DeidentifyContentRequest,DeidentifyContentResponse> deidentifyContentCallable()

De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to learn more.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeidentifyContentRequest request =
       DeidentifyContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setDeidentifyConfig(DeidentifyConfig.newBuilder().build())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setDeidentifyTemplateName("deidentifyTemplateName-1374666414")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<DeidentifyContentResponse> future =
       dlpServiceClient.deidentifyContentCallable().futureCall(request);
   // Do something.
   DeidentifyContentResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeidentifyContentRequest,DeidentifyContentResponse>

deleteDeidentifyTemplate(DeidentifyTemplateName name)

public final void deleteDeidentifyTemplate(DeidentifyTemplateName name)

Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeidentifyTemplateName name =
       DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
           "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
   dlpServiceClient.deleteDeidentifyTemplate(name);
 }
 
Parameter
NameDescription
nameDeidentifyTemplateName

Required. Resource name of the organization and deidentify template to be deleted, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

deleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest request)

public final void deleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest request)

Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteDeidentifyTemplateRequest request =
       DeleteDeidentifyTemplateRequest.newBuilder()
           .setName(
               DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
                       "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
                   .toString())
           .build();
   dlpServiceClient.deleteDeidentifyTemplate(request);
 }
 
Parameter
NameDescription
requestDeleteDeidentifyTemplateRequest

The request object containing all of the parameters for the API call.

deleteDeidentifyTemplate(String name)

public final void deleteDeidentifyTemplate(String name)

Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
               "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
           .toString();
   dlpServiceClient.deleteDeidentifyTemplate(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the organization and deidentify template to be deleted, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

deleteDeidentifyTemplateCallable()

public final UnaryCallable<DeleteDeidentifyTemplateRequest,Empty> deleteDeidentifyTemplateCallable()

Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteDeidentifyTemplateRequest request =
       DeleteDeidentifyTemplateRequest.newBuilder()
           .setName(
               DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
                       "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       dlpServiceClient.deleteDeidentifyTemplateCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteDeidentifyTemplateRequest,Empty>

deleteDlpJob(DeleteDlpJobRequest request)

public final void deleteDlpJob(DeleteDlpJobRequest request)

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteDlpJobRequest request =
       DeleteDlpJobRequest.newBuilder()
           .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
           .build();
   dlpServiceClient.deleteDlpJob(request);
 }
 
Parameter
NameDescription
requestDeleteDlpJobRequest

The request object containing all of the parameters for the API call.

deleteDlpJob(DlpJobName name)

public final void deleteDlpJob(DlpJobName name)

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DlpJobName name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]");
   dlpServiceClient.deleteDlpJob(name);
 }
 
Parameter
NameDescription
nameDlpJobName

Required. The name of the DlpJob resource to be deleted.

deleteDlpJob(String name)

public final void deleteDlpJob(String name)

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString();
   dlpServiceClient.deleteDlpJob(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the DlpJob resource to be deleted.

deleteDlpJobCallable()

public final UnaryCallable<DeleteDlpJobRequest,Empty> deleteDlpJobCallable()

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteDlpJobRequest request =
       DeleteDlpJobRequest.newBuilder()
           .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
           .build();
   ApiFuture<Empty> future = dlpServiceClient.deleteDlpJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteDlpJobRequest,Empty>

deleteInspectTemplate(DeleteInspectTemplateRequest request)

public final void deleteInspectTemplate(DeleteInspectTemplateRequest request)

Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteInspectTemplateRequest request =
       DeleteInspectTemplateRequest.newBuilder()
           .setName(
               InspectTemplateName.ofOrganizationInspectTemplateName(
                       "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
                   .toString())
           .build();
   dlpServiceClient.deleteInspectTemplate(request);
 }
 
Parameter
NameDescription
requestDeleteInspectTemplateRequest

The request object containing all of the parameters for the API call.

deleteInspectTemplate(InspectTemplateName name)

public final void deleteInspectTemplate(InspectTemplateName name)

Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   InspectTemplateName name =
       InspectTemplateName.ofOrganizationInspectTemplateName(
           "[ORGANIZATION]", "[INSPECT_TEMPLATE]");
   dlpServiceClient.deleteInspectTemplate(name);
 }
 
Parameter
NameDescription
nameInspectTemplateName

Required. Resource name of the organization and inspectTemplate to be deleted, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

deleteInspectTemplate(String name)

public final void deleteInspectTemplate(String name)

Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       InspectTemplateName.ofOrganizationInspectTemplateName(
               "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
           .toString();
   dlpServiceClient.deleteInspectTemplate(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the organization and inspectTemplate to be deleted, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

deleteInspectTemplateCallable()

public final UnaryCallable<DeleteInspectTemplateRequest,Empty> deleteInspectTemplateCallable()

Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteInspectTemplateRequest request =
       DeleteInspectTemplateRequest.newBuilder()
           .setName(
               InspectTemplateName.ofOrganizationInspectTemplateName(
                       "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
                   .toString())
           .build();
   ApiFuture<Empty> future =
       dlpServiceClient.deleteInspectTemplateCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteInspectTemplateRequest,Empty>

deleteJobTrigger(DeleteJobTriggerRequest request)

public final void deleteJobTrigger(DeleteJobTriggerRequest request)

Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteJobTriggerRequest request =
       DeleteJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .build();
   dlpServiceClient.deleteJobTrigger(request);
 }
 
Parameter
NameDescription
requestDeleteJobTriggerRequest

The request object containing all of the parameters for the API call.

deleteJobTrigger(JobTriggerName name)

public final void deleteJobTrigger(JobTriggerName name)

Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
   dlpServiceClient.deleteJobTrigger(name);
 }
 
Parameter
NameDescription
nameJobTriggerName

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

deleteJobTrigger(String name)

public final void deleteJobTrigger(String name)

Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString();
   dlpServiceClient.deleteJobTrigger(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

deleteJobTriggerCallable()

public final UnaryCallable<DeleteJobTriggerRequest,Empty> deleteJobTriggerCallable()

Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteJobTriggerRequest request =
       DeleteJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .build();
   ApiFuture<Empty> future = dlpServiceClient.deleteJobTriggerCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteJobTriggerRequest,Empty>

deleteStoredInfoType(DeleteStoredInfoTypeRequest request)

public final void deleteStoredInfoType(DeleteStoredInfoTypeRequest request)

Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteStoredInfoTypeRequest request =
       DeleteStoredInfoTypeRequest.newBuilder()
           .setName(
               StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
                       "[ORGANIZATION]", "[STORED_INFO_TYPE]")
                   .toString())
           .build();
   dlpServiceClient.deleteStoredInfoType(request);
 }
 
Parameter
NameDescription
requestDeleteStoredInfoTypeRequest

The request object containing all of the parameters for the API call.

deleteStoredInfoType(StoredInfoTypeName name)

public final void deleteStoredInfoType(StoredInfoTypeName name)

Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   StoredInfoTypeName name =
       StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
           "[ORGANIZATION]", "[STORED_INFO_TYPE]");
   dlpServiceClient.deleteStoredInfoType(name);
 }
 
Parameter
NameDescription
nameStoredInfoTypeName

Required. Resource name of the organization and storedInfoType to be deleted, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

deleteStoredInfoType(String name)

public final void deleteStoredInfoType(String name)

Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
               "[ORGANIZATION]", "[STORED_INFO_TYPE]")
           .toString();
   dlpServiceClient.deleteStoredInfoType(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the organization and storedInfoType to be deleted, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

deleteStoredInfoTypeCallable()

public final UnaryCallable<DeleteStoredInfoTypeRequest,Empty> deleteStoredInfoTypeCallable()

Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeleteStoredInfoTypeRequest request =
       DeleteStoredInfoTypeRequest.newBuilder()
           .setName(
               StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
                       "[ORGANIZATION]", "[STORED_INFO_TYPE]")
                   .toString())
           .build();
   ApiFuture<Empty> future = dlpServiceClient.deleteStoredInfoTypeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteStoredInfoTypeRequest,Empty>

finishDlpJob(FinishDlpJobRequest request)

public final void finishDlpJob(FinishDlpJobRequest request)

Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   FinishDlpJobRequest request =
       FinishDlpJobRequest.newBuilder()
           .setName(
               DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
                   .toString())
           .build();
   dlpServiceClient.finishDlpJob(request);
 }
 
Parameter
NameDescription
requestFinishDlpJobRequest

The request object containing all of the parameters for the API call.

finishDlpJobCallable()

public final UnaryCallable<FinishDlpJobRequest,Empty> finishDlpJobCallable()

Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   FinishDlpJobRequest request =
       FinishDlpJobRequest.newBuilder()
           .setName(
               DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
                   .toString())
           .build();
   ApiFuture<Empty> future = dlpServiceClient.finishDlpJobCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<FinishDlpJobRequest,Empty>

getDeidentifyTemplate(DeidentifyTemplateName name)

public final DeidentifyTemplate getDeidentifyTemplate(DeidentifyTemplateName name)

Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeidentifyTemplateName name =
       DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
           "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
   DeidentifyTemplate response = dlpServiceClient.getDeidentifyTemplate(name);
 }
 
Parameter
NameDescription
nameDeidentifyTemplateName

Required. Resource name of the organization and deidentify template to be read, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

Returns
TypeDescription
DeidentifyTemplate

getDeidentifyTemplate(GetDeidentifyTemplateRequest request)

public final DeidentifyTemplate getDeidentifyTemplate(GetDeidentifyTemplateRequest request)

Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetDeidentifyTemplateRequest request =
       GetDeidentifyTemplateRequest.newBuilder()
           .setName(
               DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
                       "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
                   .toString())
           .build();
   DeidentifyTemplate response = dlpServiceClient.getDeidentifyTemplate(request);
 }
 
Parameter
NameDescription
requestGetDeidentifyTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DeidentifyTemplate

getDeidentifyTemplate(String name)

public final DeidentifyTemplate getDeidentifyTemplate(String name)

Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
               "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
           .toString();
   DeidentifyTemplate response = dlpServiceClient.getDeidentifyTemplate(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the organization and deidentify template to be read, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

Returns
TypeDescription
DeidentifyTemplate

getDeidentifyTemplateCallable()

public final UnaryCallable<GetDeidentifyTemplateRequest,DeidentifyTemplate> getDeidentifyTemplateCallable()

Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetDeidentifyTemplateRequest request =
       GetDeidentifyTemplateRequest.newBuilder()
           .setName(
               DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
                       "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
                   .toString())
           .build();
   ApiFuture<DeidentifyTemplate> future =
       dlpServiceClient.getDeidentifyTemplateCallable().futureCall(request);
   // Do something.
   DeidentifyTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDeidentifyTemplateRequest,DeidentifyTemplate>

getDlpJob(DlpJobName name)

public final DlpJob getDlpJob(DlpJobName name)

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DlpJobName name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]");
   DlpJob response = dlpServiceClient.getDlpJob(name);
 }
 
Parameter
NameDescription
nameDlpJobName

Required. The name of the DlpJob resource.

Returns
TypeDescription
DlpJob

getDlpJob(GetDlpJobRequest request)

public final DlpJob getDlpJob(GetDlpJobRequest request)

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetDlpJobRequest request =
       GetDlpJobRequest.newBuilder()
           .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
           .build();
   DlpJob response = dlpServiceClient.getDlpJob(request);
 }
 
Parameter
NameDescription
requestGetDlpJobRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpJob

getDlpJob(String name)

public final DlpJob getDlpJob(String name)

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString();
   DlpJob response = dlpServiceClient.getDlpJob(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the DlpJob resource.

Returns
TypeDescription
DlpJob

getDlpJobCallable()

public final UnaryCallable<GetDlpJobRequest,DlpJob> getDlpJobCallable()

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetDlpJobRequest request =
       GetDlpJobRequest.newBuilder()
           .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
           .build();
   ApiFuture<DlpJob> future = dlpServiceClient.getDlpJobCallable().futureCall(request);
   // Do something.
   DlpJob response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDlpJobRequest,DlpJob>

getInspectTemplate(GetInspectTemplateRequest request)

public final InspectTemplate getInspectTemplate(GetInspectTemplateRequest request)

Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetInspectTemplateRequest request =
       GetInspectTemplateRequest.newBuilder()
           .setName(
               InspectTemplateName.ofOrganizationInspectTemplateName(
                       "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
                   .toString())
           .build();
   InspectTemplate response = dlpServiceClient.getInspectTemplate(request);
 }
 
Parameter
NameDescription
requestGetInspectTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
InspectTemplate

getInspectTemplate(InspectTemplateName name)

public final InspectTemplate getInspectTemplate(InspectTemplateName name)

Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   InspectTemplateName name =
       InspectTemplateName.ofOrganizationInspectTemplateName(
           "[ORGANIZATION]", "[INSPECT_TEMPLATE]");
   InspectTemplate response = dlpServiceClient.getInspectTemplate(name);
 }
 
Parameter
NameDescription
nameInspectTemplateName

Required. Resource name of the organization and inspectTemplate to be read, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

Returns
TypeDescription
InspectTemplate

getInspectTemplate(String name)

public final InspectTemplate getInspectTemplate(String name)

Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       InspectTemplateName.ofOrganizationInspectTemplateName(
               "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
           .toString();
   InspectTemplate response = dlpServiceClient.getInspectTemplate(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the organization and inspectTemplate to be read, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

Returns
TypeDescription
InspectTemplate

getInspectTemplateCallable()

public final UnaryCallable<GetInspectTemplateRequest,InspectTemplate> getInspectTemplateCallable()

Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetInspectTemplateRequest request =
       GetInspectTemplateRequest.newBuilder()
           .setName(
               InspectTemplateName.ofOrganizationInspectTemplateName(
                       "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
                   .toString())
           .build();
   ApiFuture<InspectTemplate> future =
       dlpServiceClient.getInspectTemplateCallable().futureCall(request);
   // Do something.
   InspectTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetInspectTemplateRequest,InspectTemplate>

getJobTrigger(GetJobTriggerRequest request)

public final JobTrigger getJobTrigger(GetJobTriggerRequest request)

Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetJobTriggerRequest request =
       GetJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .build();
   JobTrigger response = dlpServiceClient.getJobTrigger(request);
 }
 
Parameter
NameDescription
requestGetJobTriggerRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
JobTrigger

getJobTrigger(JobTriggerName name)

public final JobTrigger getJobTrigger(JobTriggerName name)

Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
   JobTrigger response = dlpServiceClient.getJobTrigger(name);
 }
 
Parameter
NameDescription
nameJobTriggerName

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

Returns
TypeDescription
JobTrigger

getJobTrigger(String name)

public final JobTrigger getJobTrigger(String name)

Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString();
   JobTrigger response = dlpServiceClient.getJobTrigger(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

Returns
TypeDescription
JobTrigger

getJobTriggerCallable()

public final UnaryCallable<GetJobTriggerRequest,JobTrigger> getJobTriggerCallable()

Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetJobTriggerRequest request =
       GetJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .build();
   ApiFuture<JobTrigger> future = dlpServiceClient.getJobTriggerCallable().futureCall(request);
   // Do something.
   JobTrigger response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetJobTriggerRequest,JobTrigger>

getSettings()

public final DlpServiceSettings getSettings()
Returns
TypeDescription
DlpServiceSettings

getStoredInfoType(GetStoredInfoTypeRequest request)

public final StoredInfoType getStoredInfoType(GetStoredInfoTypeRequest request)

Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetStoredInfoTypeRequest request =
       GetStoredInfoTypeRequest.newBuilder()
           .setName(
               StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
                       "[ORGANIZATION]", "[STORED_INFO_TYPE]")
                   .toString())
           .build();
   StoredInfoType response = dlpServiceClient.getStoredInfoType(request);
 }
 
Parameter
NameDescription
requestGetStoredInfoTypeRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
StoredInfoType

getStoredInfoType(StoredInfoTypeName name)

public final StoredInfoType getStoredInfoType(StoredInfoTypeName name)

Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   StoredInfoTypeName name =
       StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
           "[ORGANIZATION]", "[STORED_INFO_TYPE]");
   StoredInfoType response = dlpServiceClient.getStoredInfoType(name);
 }
 
Parameter
NameDescription
nameStoredInfoTypeName

Required. Resource name of the organization and storedInfoType to be read, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

Returns
TypeDescription
StoredInfoType

getStoredInfoType(String name)

public final StoredInfoType getStoredInfoType(String name)

Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
               "[ORGANIZATION]", "[STORED_INFO_TYPE]")
           .toString();
   StoredInfoType response = dlpServiceClient.getStoredInfoType(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the organization and storedInfoType to be read, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

Returns
TypeDescription
StoredInfoType

getStoredInfoTypeCallable()

public final UnaryCallable<GetStoredInfoTypeRequest,StoredInfoType> getStoredInfoTypeCallable()

Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   GetStoredInfoTypeRequest request =
       GetStoredInfoTypeRequest.newBuilder()
           .setName(
               StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
                       "[ORGANIZATION]", "[STORED_INFO_TYPE]")
                   .toString())
           .build();
   ApiFuture<StoredInfoType> future =
       dlpServiceClient.getStoredInfoTypeCallable().futureCall(request);
   // Do something.
   StoredInfoType response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetStoredInfoTypeRequest,StoredInfoType>

getStub()

public DlpServiceStub getStub()
Returns
TypeDescription
DlpServiceStub

hybridInspectDlpJob(DlpJobName name)

public final HybridInspectResponse hybridInspectDlpJob(DlpJobName name)

Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DlpJobName name =
       DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]");
   HybridInspectResponse response = dlpServiceClient.hybridInspectDlpJob(name);
 }
 
Parameter
NameDescription
nameDlpJobName

Required. Resource name of the job to execute a hybrid inspect on, for example projects/dlp-test-project/dlpJob/53234423.

Returns
TypeDescription
HybridInspectResponse

hybridInspectDlpJob(HybridInspectDlpJobRequest request)

public final HybridInspectResponse hybridInspectDlpJob(HybridInspectDlpJobRequest request)

Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   HybridInspectDlpJobRequest request =
       HybridInspectDlpJobRequest.newBuilder()
           .setName(
               DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
                   .toString())
           .setHybridItem(HybridContentItem.newBuilder().build())
           .build();
   HybridInspectResponse response = dlpServiceClient.hybridInspectDlpJob(request);
 }
 
Parameter
NameDescription
requestHybridInspectDlpJobRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
HybridInspectResponse

hybridInspectDlpJob(String name)

public final HybridInspectResponse hybridInspectDlpJob(String name)

Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString();
   HybridInspectResponse response = dlpServiceClient.hybridInspectDlpJob(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the job to execute a hybrid inspect on, for example projects/dlp-test-project/dlpJob/53234423.

Returns
TypeDescription
HybridInspectResponse

hybridInspectDlpJobCallable()

public final UnaryCallable<HybridInspectDlpJobRequest,HybridInspectResponse> hybridInspectDlpJobCallable()

Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   HybridInspectDlpJobRequest request =
       HybridInspectDlpJobRequest.newBuilder()
           .setName(
               DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
                   .toString())
           .setHybridItem(HybridContentItem.newBuilder().build())
           .build();
   ApiFuture<HybridInspectResponse> future =
       dlpServiceClient.hybridInspectDlpJobCallable().futureCall(request);
   // Do something.
   HybridInspectResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<HybridInspectDlpJobRequest,HybridInspectResponse>

hybridInspectJobTrigger(HybridInspectJobTriggerRequest request)

public final HybridInspectResponse hybridInspectJobTrigger(HybridInspectJobTriggerRequest request)

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   HybridInspectJobTriggerRequest request =
       HybridInspectJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectLocationJobTriggerName(
                       "[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]")
                   .toString())
           .setHybridItem(HybridContentItem.newBuilder().build())
           .build();
   HybridInspectResponse response = dlpServiceClient.hybridInspectJobTrigger(request);
 }
 
Parameter
NameDescription
requestHybridInspectJobTriggerRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
HybridInspectResponse

hybridInspectJobTrigger(JobTriggerName name)

public final HybridInspectResponse hybridInspectJobTrigger(JobTriggerName name)

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   JobTriggerName name =
       JobTriggerName.ofProjectLocationJobTriggerName(
           "[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]");
   HybridInspectResponse response = dlpServiceClient.hybridInspectJobTrigger(name);
 }
 
Parameter
NameDescription
nameJobTriggerName

Required. Resource name of the trigger to execute a hybrid inspect on, for example projects/dlp-test-project/jobTriggers/53234423.

Returns
TypeDescription
HybridInspectResponse

hybridInspectJobTrigger(String name)

public final HybridInspectResponse hybridInspectJobTrigger(String name)

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString();
   HybridInspectResponse response = dlpServiceClient.hybridInspectJobTrigger(name);
 }
 
Parameter
NameDescription
nameString

Required. Resource name of the trigger to execute a hybrid inspect on, for example projects/dlp-test-project/jobTriggers/53234423.

Returns
TypeDescription
HybridInspectResponse

hybridInspectJobTriggerCallable()

public final UnaryCallable<HybridInspectJobTriggerRequest,HybridInspectResponse> hybridInspectJobTriggerCallable()

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   HybridInspectJobTriggerRequest request =
       HybridInspectJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectLocationJobTriggerName(
                       "[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]")
                   .toString())
           .setHybridItem(HybridContentItem.newBuilder().build())
           .build();
   ApiFuture<HybridInspectResponse> future =
       dlpServiceClient.hybridInspectJobTriggerCallable().futureCall(request);
   // Do something.
   HybridInspectResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<HybridInspectJobTriggerRequest,HybridInspectResponse>

inspectContent(InspectContentRequest request)

public final InspectContentResponse inspectContent(InspectContentRequest request)

Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text,

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   InspectContentRequest request =
       InspectContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setLocationId("locationId1541836720")
           .build();
   InspectContentResponse response = dlpServiceClient.inspectContent(request);
 }
 
Parameter
NameDescription
requestInspectContentRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
InspectContentResponse

inspectContentCallable()

public final UnaryCallable<InspectContentRequest,InspectContentResponse> inspectContentCallable()

Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text,

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   InspectContentRequest request =
       InspectContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<InspectContentResponse> future =
       dlpServiceClient.inspectContentCallable().futureCall(request);
   // Do something.
   InspectContentResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<InspectContentRequest,InspectContentResponse>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listDeidentifyTemplates(ListDeidentifyTemplatesRequest request)

public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(ListDeidentifyTemplatesRequest request)

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListDeidentifyTemplatesRequest request =
       ListDeidentifyTemplatesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   for (DeidentifyTemplate element :
       dlpServiceClient.listDeidentifyTemplates(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDeidentifyTemplatesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpServiceClient.ListDeidentifyTemplatesPagedResponse

listDeidentifyTemplates(LocationName parent)

public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(LocationName parent)

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (DeidentifyTemplate element :
       dlpServiceClient.listDeidentifyTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDeidentifyTemplatesPagedResponse

listDeidentifyTemplates(OrganizationLocationName parent)

public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(OrganizationLocationName parent)

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   for (DeidentifyTemplate element :
       dlpServiceClient.listDeidentifyTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDeidentifyTemplatesPagedResponse

listDeidentifyTemplates(OrganizationName parent)

public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(OrganizationName parent)

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   for (DeidentifyTemplate element :
       dlpServiceClient.listDeidentifyTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDeidentifyTemplatesPagedResponse

listDeidentifyTemplates(ProjectName parent)

public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(ProjectName parent)

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (DeidentifyTemplate element :
       dlpServiceClient.listDeidentifyTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDeidentifyTemplatesPagedResponse

listDeidentifyTemplates(String parent)

public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(String parent)

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   for (DeidentifyTemplate element :
       dlpServiceClient.listDeidentifyTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDeidentifyTemplatesPagedResponse

listDeidentifyTemplatesCallable()

public final UnaryCallable<ListDeidentifyTemplatesRequest,ListDeidentifyTemplatesResponse> listDeidentifyTemplatesCallable()

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListDeidentifyTemplatesRequest request =
       ListDeidentifyTemplatesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   while (true) {
     ListDeidentifyTemplatesResponse response =
         dlpServiceClient.listDeidentifyTemplatesCallable().call(request);
     for (DeidentifyTemplate element : response.getDeidentifyTemplatesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDeidentifyTemplatesRequest,ListDeidentifyTemplatesResponse>

listDeidentifyTemplatesPagedCallable()

public final UnaryCallable<ListDeidentifyTemplatesRequest,DlpServiceClient.ListDeidentifyTemplatesPagedResponse> listDeidentifyTemplatesPagedCallable()

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListDeidentifyTemplatesRequest request =
       ListDeidentifyTemplatesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<DeidentifyTemplate> future =
       dlpServiceClient.listDeidentifyTemplatesPagedCallable().futureCall(request);
   // Do something.
   for (DeidentifyTemplate element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDeidentifyTemplatesRequest,ListDeidentifyTemplatesPagedResponse>

listDlpJobs(ListDlpJobsRequest request)

public final DlpServiceClient.ListDlpJobsPagedResponse listDlpJobs(ListDlpJobsRequest request)

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListDlpJobsRequest request =
       ListDlpJobsRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setType(DlpJobType.forNumber(0))
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   for (DlpJob element : dlpServiceClient.listDlpJobs(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDlpJobsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpServiceClient.ListDlpJobsPagedResponse

listDlpJobs(LocationName parent)

public final DlpServiceClient.ListDlpJobsPagedResponse listDlpJobs(LocationName parent)

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (DlpJob element : dlpServiceClient.listDlpJobs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDlpJobsPagedResponse

listDlpJobs(ProjectName parent)

public final DlpServiceClient.ListDlpJobsPagedResponse listDlpJobs(ProjectName parent)

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (DlpJob element : dlpServiceClient.listDlpJobs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDlpJobsPagedResponse

listDlpJobs(String parent)

public final DlpServiceClient.ListDlpJobsPagedResponse listDlpJobs(String parent)

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   for (DlpJob element : dlpServiceClient.listDlpJobs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListDlpJobsPagedResponse

listDlpJobsCallable()

public final UnaryCallable<ListDlpJobsRequest,ListDlpJobsResponse> listDlpJobsCallable()

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListDlpJobsRequest request =
       ListDlpJobsRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setType(DlpJobType.forNumber(0))
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   while (true) {
     ListDlpJobsResponse response = dlpServiceClient.listDlpJobsCallable().call(request);
     for (DlpJob element : response.getJobsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDlpJobsRequest,ListDlpJobsResponse>

listDlpJobsPagedCallable()

public final UnaryCallable<ListDlpJobsRequest,DlpServiceClient.ListDlpJobsPagedResponse> listDlpJobsPagedCallable()

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListDlpJobsRequest request =
       ListDlpJobsRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setType(DlpJobType.forNumber(0))
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<DlpJob> future = dlpServiceClient.listDlpJobsPagedCallable().futureCall(request);
   // Do something.
   for (DlpJob element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDlpJobsRequest,ListDlpJobsPagedResponse>

listInfoTypes(ListInfoTypesRequest request)

public final ListInfoTypesResponse listInfoTypes(ListInfoTypesRequest request)

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListInfoTypesRequest request =
       ListInfoTypesRequest.newBuilder()
           .setParent("parent-995424086")
           .setLanguageCode("languageCode-2092349083")
           .setFilter("filter-1274492040")
           .setLocationId("locationId1541836720")
           .build();
   ListInfoTypesResponse response = dlpServiceClient.listInfoTypes(request);
 }
 
Parameter
NameDescription
requestListInfoTypesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ListInfoTypesResponse

listInfoTypes(String parent)

public final ListInfoTypesResponse listInfoTypes(String parent)

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = "parent-995424086";
   ListInfoTypesResponse response = dlpServiceClient.listInfoTypes(parent);
 }
 
Parameter
NameDescription
parentString

The parent resource name.

The format of this value is as follows:

locations/<var>LOCATION_ID</var>

Returns
TypeDescription
ListInfoTypesResponse

listInfoTypesCallable()

public final UnaryCallable<ListInfoTypesRequest,ListInfoTypesResponse> listInfoTypesCallable()

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListInfoTypesRequest request =
       ListInfoTypesRequest.newBuilder()
           .setParent("parent-995424086")
           .setLanguageCode("languageCode-2092349083")
           .setFilter("filter-1274492040")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<ListInfoTypesResponse> future =
       dlpServiceClient.listInfoTypesCallable().futureCall(request);
   // Do something.
   ListInfoTypesResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ListInfoTypesRequest,ListInfoTypesResponse>

listInspectTemplates(ListInspectTemplatesRequest request)

public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(ListInspectTemplatesRequest request)

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListInspectTemplatesRequest request =
       ListInspectTemplatesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   for (InspectTemplate element : dlpServiceClient.listInspectTemplates(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListInspectTemplatesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpServiceClient.ListInspectTemplatesPagedResponse

listInspectTemplates(LocationName parent)

public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(LocationName parent)

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (InspectTemplate element : dlpServiceClient.listInspectTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListInspectTemplatesPagedResponse

listInspectTemplates(OrganizationLocationName parent)

public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(OrganizationLocationName parent)

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   for (InspectTemplate element : dlpServiceClient.listInspectTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListInspectTemplatesPagedResponse

listInspectTemplates(OrganizationName parent)

public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(OrganizationName parent)

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   for (InspectTemplate element : dlpServiceClient.listInspectTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListInspectTemplatesPagedResponse

listInspectTemplates(ProjectName parent)

public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(ProjectName parent)

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (InspectTemplate element : dlpServiceClient.listInspectTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListInspectTemplatesPagedResponse

listInspectTemplates(String parent)

public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(String parent)

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   for (InspectTemplate element : dlpServiceClient.listInspectTemplates(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var> + Organizations scope, location specified:<br/> organizations/<var>ORG_ID</var>/locations/<var>LOCATION_ID</var>
  • Organizations scope, no location specified (defaults to global):<br/> organizations/<var>ORG_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListInspectTemplatesPagedResponse

listInspectTemplatesCallable()

public final UnaryCallable<ListInspectTemplatesRequest,ListInspectTemplatesResponse> listInspectTemplatesCallable()

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListInspectTemplatesRequest request =
       ListInspectTemplatesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   while (true) {
     ListInspectTemplatesResponse response =
         dlpServiceClient.listInspectTemplatesCallable().call(request);
     for (InspectTemplate element : response.getInspectTemplatesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListInspectTemplatesRequest,ListInspectTemplatesResponse>

listInspectTemplatesPagedCallable()

public final UnaryCallable<ListInspectTemplatesRequest,DlpServiceClient.ListInspectTemplatesPagedResponse> listInspectTemplatesPagedCallable()

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListInspectTemplatesRequest request =
       ListInspectTemplatesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<InspectTemplate> future =
       dlpServiceClient.listInspectTemplatesPagedCallable().futureCall(request);
   // Do something.
   for (InspectTemplate element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListInspectTemplatesRequest,ListInspectTemplatesPagedResponse>

listJobTriggers(ListJobTriggersRequest request)

public final DlpServiceClient.ListJobTriggersPagedResponse listJobTriggers(ListJobTriggersRequest request)

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListJobTriggersRequest request =
       ListJobTriggersRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setFilter("filter-1274492040")
           .setType(DlpJobType.forNumber(0))
           .setLocationId("locationId1541836720")
           .build();
   for (JobTrigger element : dlpServiceClient.listJobTriggers(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListJobTriggersRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpServiceClient.ListJobTriggersPagedResponse

listJobTriggers(LocationName parent)

public final DlpServiceClient.ListJobTriggersPagedResponse listJobTriggers(LocationName parent)

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (JobTrigger element : dlpServiceClient.listJobTriggers(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListJobTriggersPagedResponse

listJobTriggers(ProjectName parent)

public final DlpServiceClient.ListJobTriggersPagedResponse listJobTriggers(ProjectName parent)

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (JobTrigger element : dlpServiceClient.listJobTriggers(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListJobTriggersPagedResponse

listJobTriggers(String parent)

public final DlpServiceClient.ListJobTriggersPagedResponse listJobTriggers(String parent)

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = ProjectName.of("[PROJECT]").toString();
   for (JobTrigger element : dlpServiceClient.listJobTriggers(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListJobTriggersPagedResponse

listJobTriggersCallable()

public final UnaryCallable<ListJobTriggersRequest,ListJobTriggersResponse> listJobTriggersCallable()

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListJobTriggersRequest request =
       ListJobTriggersRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setFilter("filter-1274492040")
           .setType(DlpJobType.forNumber(0))
           .setLocationId("locationId1541836720")
           .build();
   while (true) {
     ListJobTriggersResponse response = dlpServiceClient.listJobTriggersCallable().call(request);
     for (JobTrigger element : response.getJobTriggersList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListJobTriggersRequest,ListJobTriggersResponse>

listJobTriggersPagedCallable()

public final UnaryCallable<ListJobTriggersRequest,DlpServiceClient.ListJobTriggersPagedResponse> listJobTriggersPagedCallable()

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListJobTriggersRequest request =
       ListJobTriggersRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setFilter("filter-1274492040")
           .setType(DlpJobType.forNumber(0))
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<JobTrigger> future =
       dlpServiceClient.listJobTriggersPagedCallable().futureCall(request);
   // Do something.
   for (JobTrigger element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListJobTriggersRequest,ListJobTriggersPagedResponse>

listStoredInfoTypes(ListStoredInfoTypesRequest request)

public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(ListStoredInfoTypesRequest request)

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListStoredInfoTypesRequest request =
       ListStoredInfoTypesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListStoredInfoTypesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DlpServiceClient.ListStoredInfoTypesPagedResponse

listStoredInfoTypes(LocationName parent)

public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(LocationName parent)

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListStoredInfoTypesPagedResponse

listStoredInfoTypes(OrganizationLocationName parent)

public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(OrganizationLocationName parent)

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationLocationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListStoredInfoTypesPagedResponse

listStoredInfoTypes(OrganizationName parent)

public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(OrganizationName parent)

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
   for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentOrganizationName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListStoredInfoTypesPagedResponse

listStoredInfoTypes(ProjectName parent)

public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(ProjectName parent)

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentProjectName

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListStoredInfoTypesPagedResponse

listStoredInfoTypes(String parent)

public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(String parent)

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String parent = OrganizationName.of("[ORGANIZATION]").toString();
   for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent resource name.

The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:

+ Projects scope, location specified:<br/> projects/<var>PROJECT_ID</var>/locations/<var>LOCATION_ID</var>

  • Projects scope, no location specified (defaults to global):<br/> projects/<var>PROJECT_ID</var>

    The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data:

    parent=projects/example-project/locations/europe-west3

Returns
TypeDescription
DlpServiceClient.ListStoredInfoTypesPagedResponse

listStoredInfoTypesCallable()

public final UnaryCallable<ListStoredInfoTypesRequest,ListStoredInfoTypesResponse> listStoredInfoTypesCallable()

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListStoredInfoTypesRequest request =
       ListStoredInfoTypesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   while (true) {
     ListStoredInfoTypesResponse response =
         dlpServiceClient.listStoredInfoTypesCallable().call(request);
     for (StoredInfoType element : response.getStoredInfoTypesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListStoredInfoTypesRequest,ListStoredInfoTypesResponse>

listStoredInfoTypesPagedCallable()

public final UnaryCallable<ListStoredInfoTypesRequest,DlpServiceClient.ListStoredInfoTypesPagedResponse> listStoredInfoTypesPagedCallable()

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ListStoredInfoTypesRequest request =
       ListStoredInfoTypesRequest.newBuilder()
           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
           .setPageToken("pageToken873572522")
           .setPageSize(883849137)
           .setOrderBy("orderBy-1207110587")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<StoredInfoType> future =
       dlpServiceClient.listStoredInfoTypesPagedCallable().futureCall(request);
   // Do something.
   for (StoredInfoType element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListStoredInfoTypesRequest,ListStoredInfoTypesPagedResponse>

redactImage(RedactImageRequest request)

public final RedactImageResponse redactImage(RedactImageRequest request)

Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to learn more.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   RedactImageRequest request =
       RedactImageRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setLocationId("locationId1541836720")
           .setInspectConfig(InspectConfig.newBuilder().build())
           .addAllImageRedactionConfigs(new ArrayList<RedactImageRequest.ImageRedactionConfig>())
           .setIncludeFindings(true)
           .setByteItem(ByteContentItem.newBuilder().build())
           .build();
   RedactImageResponse response = dlpServiceClient.redactImage(request);
 }
 
Parameter
NameDescription
requestRedactImageRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
RedactImageResponse

redactImageCallable()

public final UnaryCallable<RedactImageRequest,RedactImageResponse> redactImageCallable()

Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to learn more.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   RedactImageRequest request =
       RedactImageRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setLocationId("locationId1541836720")
           .setInspectConfig(InspectConfig.newBuilder().build())
           .addAllImageRedactionConfigs(new ArrayList<RedactImageRequest.ImageRedactionConfig>())
           .setIncludeFindings(true)
           .setByteItem(ByteContentItem.newBuilder().build())
           .build();
   ApiFuture<RedactImageResponse> future =
       dlpServiceClient.redactImageCallable().futureCall(request);
   // Do something.
   RedactImageResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<RedactImageRequest,RedactImageResponse>

reidentifyContent(ReidentifyContentRequest request)

public final ReidentifyContentResponse reidentifyContent(ReidentifyContentRequest request)

Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ReidentifyContentRequest request =
       ReidentifyContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setReidentifyConfig(DeidentifyConfig.newBuilder().build())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setReidentifyTemplateName("reidentifyTemplateName157316612")
           .setLocationId("locationId1541836720")
           .build();
   ReidentifyContentResponse response = dlpServiceClient.reidentifyContent(request);
 }
 
Parameter
NameDescription
requestReidentifyContentRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ReidentifyContentResponse

reidentifyContentCallable()

public final UnaryCallable<ReidentifyContentRequest,ReidentifyContentResponse> reidentifyContentCallable()

Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   ReidentifyContentRequest request =
       ReidentifyContentRequest.newBuilder()
           .setParent(ProjectName.of("[PROJECT]").toString())
           .setReidentifyConfig(DeidentifyConfig.newBuilder().build())
           .setInspectConfig(InspectConfig.newBuilder().build())
           .setItem(ContentItem.newBuilder().build())
           .setInspectTemplateName("inspectTemplateName1828857433")
           .setReidentifyTemplateName("reidentifyTemplateName157316612")
           .setLocationId("locationId1541836720")
           .build();
   ApiFuture<ReidentifyContentResponse> future =
       dlpServiceClient.reidentifyContentCallable().futureCall(request);
   // Do something.
   ReidentifyContentResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ReidentifyContentRequest,ReidentifyContentResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateDeidentifyTemplate(DeidentifyTemplateName name, DeidentifyTemplate deidentifyTemplate, FieldMask updateMask)

public final DeidentifyTemplate updateDeidentifyTemplate(DeidentifyTemplateName name, DeidentifyTemplate deidentifyTemplate, FieldMask updateMask)

Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   DeidentifyTemplateName name =
       DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
           "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.updateDeidentifyTemplate(name, deidentifyTemplate, updateMask);
 }
 
Parameters
NameDescription
nameDeidentifyTemplateName

Required. Resource name of organization and deidentify template to be updated, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

deidentifyTemplateDeidentifyTemplate

New DeidentifyTemplate value.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
DeidentifyTemplate

updateDeidentifyTemplate(UpdateDeidentifyTemplateRequest request)

public final DeidentifyTemplate updateDeidentifyTemplate(UpdateDeidentifyTemplateRequest request)

Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateDeidentifyTemplateRequest request =
       UpdateDeidentifyTemplateRequest.newBuilder()
           .setName(
               DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
                       "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
                   .toString())
           .setDeidentifyTemplate(DeidentifyTemplate.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   DeidentifyTemplate response = dlpServiceClient.updateDeidentifyTemplate(request);
 }
 
Parameter
NameDescription
requestUpdateDeidentifyTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DeidentifyTemplate

updateDeidentifyTemplate(String name, DeidentifyTemplate deidentifyTemplate, FieldMask updateMask)

public final DeidentifyTemplate updateDeidentifyTemplate(String name, DeidentifyTemplate deidentifyTemplate, FieldMask updateMask)

Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
               "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
           .toString();
   DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   DeidentifyTemplate response =
       dlpServiceClient.updateDeidentifyTemplate(name, deidentifyTemplate, updateMask);
 }
 
Parameters
NameDescription
nameString

Required. Resource name of organization and deidentify template to be updated, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342.

deidentifyTemplateDeidentifyTemplate

New DeidentifyTemplate value.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
DeidentifyTemplate

updateDeidentifyTemplateCallable()

public final UnaryCallable<UpdateDeidentifyTemplateRequest,DeidentifyTemplate> updateDeidentifyTemplateCallable()

Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateDeidentifyTemplateRequest request =
       UpdateDeidentifyTemplateRequest.newBuilder()
           .setName(
               DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName(
                       "[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
                   .toString())
           .setDeidentifyTemplate(DeidentifyTemplate.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<DeidentifyTemplate> future =
       dlpServiceClient.updateDeidentifyTemplateCallable().futureCall(request);
   // Do something.
   DeidentifyTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateDeidentifyTemplateRequest,DeidentifyTemplate>

updateInspectTemplate(InspectTemplateName name, InspectTemplate inspectTemplate, FieldMask updateMask)

public final InspectTemplate updateInspectTemplate(InspectTemplateName name, InspectTemplate inspectTemplate, FieldMask updateMask)

Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   InspectTemplateName name =
       InspectTemplateName.ofOrganizationInspectTemplateName(
           "[ORGANIZATION]", "[INSPECT_TEMPLATE]");
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   InspectTemplate response =
       dlpServiceClient.updateInspectTemplate(name, inspectTemplate, updateMask);
 }
 
Parameters
NameDescription
nameInspectTemplateName

Required. Resource name of organization and inspectTemplate to be updated, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

inspectTemplateInspectTemplate

New InspectTemplate value.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
InspectTemplate

updateInspectTemplate(UpdateInspectTemplateRequest request)

public final InspectTemplate updateInspectTemplate(UpdateInspectTemplateRequest request)

Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateInspectTemplateRequest request =
       UpdateInspectTemplateRequest.newBuilder()
           .setName(
               InspectTemplateName.ofOrganizationInspectTemplateName(
                       "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
                   .toString())
           .setInspectTemplate(InspectTemplate.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   InspectTemplate response = dlpServiceClient.updateInspectTemplate(request);
 }
 
Parameter
NameDescription
requestUpdateInspectTemplateRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
InspectTemplate

updateInspectTemplate(String name, InspectTemplate inspectTemplate, FieldMask updateMask)

public final InspectTemplate updateInspectTemplate(String name, InspectTemplate inspectTemplate, FieldMask updateMask)

Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       InspectTemplateName.ofOrganizationInspectTemplateName(
               "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
           .toString();
   InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   InspectTemplate response =
       dlpServiceClient.updateInspectTemplate(name, inspectTemplate, updateMask);
 }
 
Parameters
NameDescription
nameString

Required. Resource name of organization and inspectTemplate to be updated, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342.

inspectTemplateInspectTemplate

New InspectTemplate value.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
InspectTemplate

updateInspectTemplateCallable()

public final UnaryCallable<UpdateInspectTemplateRequest,InspectTemplate> updateInspectTemplateCallable()

Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateInspectTemplateRequest request =
       UpdateInspectTemplateRequest.newBuilder()
           .setName(
               InspectTemplateName.ofOrganizationInspectTemplateName(
                       "[ORGANIZATION]", "[INSPECT_TEMPLATE]")
                   .toString())
           .setInspectTemplate(InspectTemplate.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<InspectTemplate> future =
       dlpServiceClient.updateInspectTemplateCallable().futureCall(request);
   // Do something.
   InspectTemplate response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateInspectTemplateRequest,InspectTemplate>

updateJobTrigger(JobTriggerName name, JobTrigger jobTrigger, FieldMask updateMask)

public final JobTrigger updateJobTrigger(JobTriggerName name, JobTrigger jobTrigger, FieldMask updateMask)

Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
   JobTrigger jobTrigger = JobTrigger.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   JobTrigger response = dlpServiceClient.updateJobTrigger(name, jobTrigger, updateMask);
 }
 
Parameters
NameDescription
nameJobTriggerName

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

jobTriggerJobTrigger

New JobTrigger value.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
JobTrigger

updateJobTrigger(UpdateJobTriggerRequest request)

public final JobTrigger updateJobTrigger(UpdateJobTriggerRequest request)

Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateJobTriggerRequest request =
       UpdateJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .setJobTrigger(JobTrigger.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   JobTrigger response = dlpServiceClient.updateJobTrigger(request);
 }
 
Parameter
NameDescription
requestUpdateJobTriggerRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
JobTrigger

updateJobTrigger(String name, JobTrigger jobTrigger, FieldMask updateMask)

public final JobTrigger updateJobTrigger(String name, JobTrigger jobTrigger, FieldMask updateMask)

Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString();
   JobTrigger jobTrigger = JobTrigger.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   JobTrigger response = dlpServiceClient.updateJobTrigger(name, jobTrigger, updateMask);
 }
 
Parameters
NameDescription
nameString

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423.

jobTriggerJobTrigger

New JobTrigger value.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
JobTrigger

updateJobTriggerCallable()

public final UnaryCallable<UpdateJobTriggerRequest,JobTrigger> updateJobTriggerCallable()

Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateJobTriggerRequest request =
       UpdateJobTriggerRequest.newBuilder()
           .setName(
               JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
           .setJobTrigger(JobTrigger.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<JobTrigger> future =
       dlpServiceClient.updateJobTriggerCallable().futureCall(request);
   // Do something.
   JobTrigger response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateJobTriggerRequest,JobTrigger>

updateStoredInfoType(StoredInfoTypeName name, StoredInfoTypeConfig config, FieldMask updateMask)

public final StoredInfoType updateStoredInfoType(StoredInfoTypeName name, StoredInfoTypeConfig config, FieldMask updateMask)

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   StoredInfoTypeName name =
       StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
           "[ORGANIZATION]", "[STORED_INFO_TYPE]");
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   StoredInfoType response = dlpServiceClient.updateStoredInfoType(name, config, updateMask);
 }
 
Parameters
NameDescription
nameStoredInfoTypeName

Required. Resource name of organization and storedInfoType to be updated, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

configStoredInfoTypeConfig

Updated configuration for the storedInfoType. If not provided, a new version of the storedInfoType will be created with the existing configuration.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
StoredInfoType

updateStoredInfoType(UpdateStoredInfoTypeRequest request)

public final StoredInfoType updateStoredInfoType(UpdateStoredInfoTypeRequest request)

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateStoredInfoTypeRequest request =
       UpdateStoredInfoTypeRequest.newBuilder()
           .setName(
               StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
                       "[ORGANIZATION]", "[STORED_INFO_TYPE]")
                   .toString())
           .setConfig(StoredInfoTypeConfig.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   StoredInfoType response = dlpServiceClient.updateStoredInfoType(request);
 }
 
Parameter
NameDescription
requestUpdateStoredInfoTypeRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
StoredInfoType

updateStoredInfoType(String name, StoredInfoTypeConfig config, FieldMask updateMask)

public final StoredInfoType updateStoredInfoType(String name, StoredInfoTypeConfig config, FieldMask updateMask)

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   String name =
       StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
               "[ORGANIZATION]", "[STORED_INFO_TYPE]")
           .toString();
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   StoredInfoType response = dlpServiceClient.updateStoredInfoType(name, config, updateMask);
 }
 
Parameters
NameDescription
nameString

Required. Resource name of organization and storedInfoType to be updated, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342.

configStoredInfoTypeConfig

Updated configuration for the storedInfoType. If not provided, a new version of the storedInfoType will be created with the existing configuration.

updateMaskFieldMask

Mask to control which fields get updated.

Returns
TypeDescription
StoredInfoType

updateStoredInfoTypeCallable()

public final UnaryCallable<UpdateStoredInfoTypeRequest,StoredInfoType> updateStoredInfoTypeCallable()

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   UpdateStoredInfoTypeRequest request =
       UpdateStoredInfoTypeRequest.newBuilder()
           .setName(
               StoredInfoTypeName.ofOrganizationStoredInfoTypeName(
                       "[ORGANIZATION]", "[STORED_INFO_TYPE]")
                   .toString())
           .setConfig(StoredInfoTypeConfig.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<StoredInfoType> future =
       dlpServiceClient.updateStoredInfoTypeCallable().futureCall(request);
   // Do something.
   StoredInfoType response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateStoredInfoTypeRequest,StoredInfoType>