Class DlpServiceClient (3.6.7)

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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 DlpServiceSettings dlpServiceSettings =
     DlpServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 DlpServiceSettings dlpServiceSettings =
     DlpServiceSettings.newBuilder()
         .setTransportChannelProvider(
             DlpServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
         .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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 re-using 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 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 for illustrative purposes only.
 // It may require modifications to work in your environment.
 try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
   StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
 }