@Generated(value="by gapic-generator") @BetaApi public class DlpServiceClient extends Object implements BackgroundResource
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
InspectContentRequest request = InspectContentRequest.newBuilder()
.setParent(parent.toString())
.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:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DlpServiceSettings to create(). For example:
To customize credentials:
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DlpServiceClient dlpServiceClient =
DlpServiceClient.create(dlpServiceSettings);
To customize the endpoint:
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DlpServiceClient dlpServiceClient =
DlpServiceClient.create(dlpServiceSettings);
Modifier and Type | Class and Description |
---|---|
static class |
DlpServiceClient.ListDeidentifyTemplatesFixedSizeCollection |
static class |
DlpServiceClient.ListDeidentifyTemplatesPage |
static class |
DlpServiceClient.ListDeidentifyTemplatesPagedResponse |
static class |
DlpServiceClient.ListDlpJobsFixedSizeCollection |
static class |
DlpServiceClient.ListDlpJobsPage |
static class |
DlpServiceClient.ListDlpJobsPagedResponse |
static class |
DlpServiceClient.ListInspectTemplatesFixedSizeCollection |
static class |
DlpServiceClient.ListInspectTemplatesPage |
static class |
DlpServiceClient.ListInspectTemplatesPagedResponse |
static class |
DlpServiceClient.ListJobTriggersFixedSizeCollection |
static class |
DlpServiceClient.ListJobTriggersPage |
static class |
DlpServiceClient.ListJobTriggersPagedResponse |
static class |
DlpServiceClient.ListStoredInfoTypesFixedSizeCollection |
static class |
DlpServiceClient.ListStoredInfoTypesPage |
static class |
DlpServiceClient.ListStoredInfoTypesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
DlpServiceClient(DlpServiceSettings settings)
Constructs an instance of DlpServiceClient, using the given settings.
|
protected |
DlpServiceClient(DlpServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
cancelDlpJob(com.google.privacy.dlp.v2.CancelDlpJobRequest request)
Starts asynchronous cancellation on a long-running DlpJob.
|
UnaryCallable<com.google.privacy.dlp.v2.CancelDlpJobRequest,Empty> |
cancelDlpJobCallable()
Starts asynchronous cancellation on a long-running DlpJob.
|
void |
close() |
static DlpServiceClient |
create()
Constructs an instance of DlpServiceClient with default settings.
|
static DlpServiceClient |
create(DlpServiceSettings settings)
Constructs an instance of DlpServiceClient, using the given settings.
|
static DlpServiceClient |
create(DlpServiceStub stub)
Constructs an instance of DlpServiceClient, using the given stub for making calls.
|
com.google.privacy.dlp.v2.DeidentifyTemplate |
createDeidentifyTemplate(com.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest request)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying
content, images, and storage.
|
UnaryCallable<com.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest,com.google.privacy.dlp.v2.DeidentifyTemplate> |
createDeidentifyTemplateCallable()
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying
content, images, and storage.
|
com.google.privacy.dlp.v2.DlpJob |
createDlpJob(com.google.privacy.dlp.v2.CreateDlpJobRequest request)
Creates a new job to inspect storage or calculate risk metrics.
|
UnaryCallable<com.google.privacy.dlp.v2.CreateDlpJobRequest,com.google.privacy.dlp.v2.DlpJob> |
createDlpJobCallable()
Creates a new job to inspect storage or calculate risk metrics.
|
com.google.privacy.dlp.v2.InspectTemplate |
createInspectTemplate(com.google.privacy.dlp.v2.CreateInspectTemplateRequest request)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content,
images, and storage.
|
UnaryCallable<com.google.privacy.dlp.v2.CreateInspectTemplateRequest,com.google.privacy.dlp.v2.InspectTemplate> |
createInspectTemplateCallable()
Creates an InspectTemplate for re-using frequently used configuration for inspecting content,
images, and storage.
|
com.google.privacy.dlp.v2.JobTrigger |
createJobTrigger(com.google.privacy.dlp.v2.CreateJobTriggerRequest request)
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on
a set schedule.
|
UnaryCallable<com.google.privacy.dlp.v2.CreateJobTriggerRequest,com.google.privacy.dlp.v2.JobTrigger> |
createJobTriggerCallable()
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on
a set schedule.
|
com.google.privacy.dlp.v2.StoredInfoType |
createStoredInfoType(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest request)
Creates a pre-built stored infoType to be used for inspection.
|
UnaryCallable<com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest,com.google.privacy.dlp.v2.StoredInfoType> |
createStoredInfoTypeCallable()
Creates a pre-built stored infoType to be used for inspection.
|
com.google.privacy.dlp.v2.DeidentifyContentResponse |
deidentifyContent(com.google.privacy.dlp.v2.DeidentifyContentRequest request)
De-identifies potentially sensitive info from a ContentItem.
|
UnaryCallable<com.google.privacy.dlp.v2.DeidentifyContentRequest,com.google.privacy.dlp.v2.DeidentifyContentResponse> |
deidentifyContentCallable()
De-identifies potentially sensitive info from a ContentItem.
|
void |
deleteDeidentifyTemplate(com.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest request)
Deletes a DeidentifyTemplate.
|
UnaryCallable<com.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest,Empty> |
deleteDeidentifyTemplateCallable()
Deletes a DeidentifyTemplate.
|
void |
deleteDlpJob(com.google.privacy.dlp.v2.DeleteDlpJobRequest request)
Deletes a long-running DlpJob.
|
UnaryCallable<com.google.privacy.dlp.v2.DeleteDlpJobRequest,Empty> |
deleteDlpJobCallable()
Deletes a long-running DlpJob.
|
void |
deleteInspectTemplate(com.google.privacy.dlp.v2.DeleteInspectTemplateRequest request)
Deletes an InspectTemplate.
|
UnaryCallable<com.google.privacy.dlp.v2.DeleteInspectTemplateRequest,Empty> |
deleteInspectTemplateCallable()
Deletes an InspectTemplate.
|
void |
deleteJobTrigger(com.google.privacy.dlp.v2.DeleteJobTriggerRequest request)
Deletes a job trigger.
|
UnaryCallable<com.google.privacy.dlp.v2.DeleteJobTriggerRequest,Empty> |
deleteJobTriggerCallable()
Deletes a job trigger.
|
void |
deleteStoredInfoType(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest request)
Deletes a stored infoType.
|
UnaryCallable<com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest,Empty> |
deleteStoredInfoTypeCallable()
Deletes a stored infoType.
|
com.google.privacy.dlp.v2.DeidentifyTemplate |
getDeidentifyTemplate(com.google.privacy.dlp.v2.GetDeidentifyTemplateRequest request)
Gets a DeidentifyTemplate.
|
UnaryCallable<com.google.privacy.dlp.v2.GetDeidentifyTemplateRequest,com.google.privacy.dlp.v2.DeidentifyTemplate> |
getDeidentifyTemplateCallable()
Gets a DeidentifyTemplate.
|
com.google.privacy.dlp.v2.DlpJob |
getDlpJob(com.google.privacy.dlp.v2.GetDlpJobRequest request)
Gets the latest state of a long-running DlpJob.
|
UnaryCallable<com.google.privacy.dlp.v2.GetDlpJobRequest,com.google.privacy.dlp.v2.DlpJob> |
getDlpJobCallable()
Gets the latest state of a long-running DlpJob.
|
com.google.privacy.dlp.v2.InspectTemplate |
getInspectTemplate(com.google.privacy.dlp.v2.GetInspectTemplateRequest request)
Gets an InspectTemplate.
|
UnaryCallable<com.google.privacy.dlp.v2.GetInspectTemplateRequest,com.google.privacy.dlp.v2.InspectTemplate> |
getInspectTemplateCallable()
Gets an InspectTemplate.
|
com.google.privacy.dlp.v2.JobTrigger |
getJobTrigger(com.google.privacy.dlp.v2.GetJobTriggerRequest request)
Gets a job trigger.
|
UnaryCallable<com.google.privacy.dlp.v2.GetJobTriggerRequest,com.google.privacy.dlp.v2.JobTrigger> |
getJobTriggerCallable()
Gets a job trigger.
|
DlpServiceSettings |
getSettings() |
com.google.privacy.dlp.v2.StoredInfoType |
getStoredInfoType(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest request)
Gets a stored infoType.
|
UnaryCallable<com.google.privacy.dlp.v2.GetStoredInfoTypeRequest,com.google.privacy.dlp.v2.StoredInfoType> |
getStoredInfoTypeCallable()
Gets a stored infoType.
|
DlpServiceStub |
getStub() |
com.google.privacy.dlp.v2.InspectContentResponse |
inspectContent(com.google.privacy.dlp.v2.InspectContentRequest request)
Finds potentially sensitive info in content.
|
UnaryCallable<com.google.privacy.dlp.v2.InspectContentRequest,com.google.privacy.dlp.v2.InspectContentResponse> |
inspectContentCallable()
Finds potentially sensitive info in content.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
DlpServiceClient.ListDeidentifyTemplatesPagedResponse |
listDeidentifyTemplates(com.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest request)
Lists DeidentifyTemplates.
|
UnaryCallable<com.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest,com.google.privacy.dlp.v2.ListDeidentifyTemplatesResponse> |
listDeidentifyTemplatesCallable()
Lists DeidentifyTemplates.
|
UnaryCallable<com.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest,DlpServiceClient.ListDeidentifyTemplatesPagedResponse> |
listDeidentifyTemplatesPagedCallable()
Lists DeidentifyTemplates.
|
DlpServiceClient.ListDlpJobsPagedResponse |
listDlpJobs(com.google.privacy.dlp.v2.ListDlpJobsRequest request)
Lists DlpJobs that match the specified filter in the request.
|
UnaryCallable<com.google.privacy.dlp.v2.ListDlpJobsRequest,com.google.privacy.dlp.v2.ListDlpJobsResponse> |
listDlpJobsCallable()
Lists DlpJobs that match the specified filter in the request.
|
UnaryCallable<com.google.privacy.dlp.v2.ListDlpJobsRequest,DlpServiceClient.ListDlpJobsPagedResponse> |
listDlpJobsPagedCallable()
Lists DlpJobs that match the specified filter in the request.
|
com.google.privacy.dlp.v2.ListInfoTypesResponse |
listInfoTypes(com.google.privacy.dlp.v2.ListInfoTypesRequest request)
Returns a list of the sensitive information types that the DLP API supports.
|
UnaryCallable<com.google.privacy.dlp.v2.ListInfoTypesRequest,com.google.privacy.dlp.v2.ListInfoTypesResponse> |
listInfoTypesCallable()
Returns a list of the sensitive information types that the DLP API supports.
|
DlpServiceClient.ListInspectTemplatesPagedResponse |
listInspectTemplates(com.google.privacy.dlp.v2.ListInspectTemplatesRequest request)
Lists InspectTemplates.
|
UnaryCallable<com.google.privacy.dlp.v2.ListInspectTemplatesRequest,com.google.privacy.dlp.v2.ListInspectTemplatesResponse> |
listInspectTemplatesCallable()
Lists InspectTemplates.
|
UnaryCallable<com.google.privacy.dlp.v2.ListInspectTemplatesRequest,DlpServiceClient.ListInspectTemplatesPagedResponse> |
listInspectTemplatesPagedCallable()
Lists InspectTemplates.
|
DlpServiceClient.ListJobTriggersPagedResponse |
listJobTriggers(com.google.privacy.dlp.v2.ListJobTriggersRequest request)
Lists job triggers.
|
UnaryCallable<com.google.privacy.dlp.v2.ListJobTriggersRequest,com.google.privacy.dlp.v2.ListJobTriggersResponse> |
listJobTriggersCallable()
Lists job triggers.
|
UnaryCallable<com.google.privacy.dlp.v2.ListJobTriggersRequest,DlpServiceClient.ListJobTriggersPagedResponse> |
listJobTriggersPagedCallable()
Lists job triggers.
|
DlpServiceClient.ListStoredInfoTypesPagedResponse |
listStoredInfoTypes(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest request)
Lists stored infoTypes.
|
UnaryCallable<com.google.privacy.dlp.v2.ListStoredInfoTypesRequest,com.google.privacy.dlp.v2.ListStoredInfoTypesResponse> |
listStoredInfoTypesCallable()
Lists stored infoTypes.
|
UnaryCallable<com.google.privacy.dlp.v2.ListStoredInfoTypesRequest,DlpServiceClient.ListStoredInfoTypesPagedResponse> |
listStoredInfoTypesPagedCallable()
Lists stored infoTypes.
|
com.google.privacy.dlp.v2.RedactImageResponse |
redactImage(com.google.privacy.dlp.v2.RedactImageRequest request)
Redacts potentially sensitive info from an image.
|
UnaryCallable<com.google.privacy.dlp.v2.RedactImageRequest,com.google.privacy.dlp.v2.RedactImageResponse> |
redactImageCallable()
Redacts potentially sensitive info from an image.
|
com.google.privacy.dlp.v2.ReidentifyContentResponse |
reidentifyContent(com.google.privacy.dlp.v2.ReidentifyContentRequest request)
Re-identifies content that has been de-identified.
|
UnaryCallable<com.google.privacy.dlp.v2.ReidentifyContentRequest,com.google.privacy.dlp.v2.ReidentifyContentResponse> |
reidentifyContentCallable()
Re-identifies content that has been de-identified.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.privacy.dlp.v2.DeidentifyTemplate |
updateDeidentifyTemplate(com.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest request)
Updates the DeidentifyTemplate.
|
UnaryCallable<com.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest,com.google.privacy.dlp.v2.DeidentifyTemplate> |
updateDeidentifyTemplateCallable()
Updates the DeidentifyTemplate.
|
com.google.privacy.dlp.v2.InspectTemplate |
updateInspectTemplate(com.google.privacy.dlp.v2.UpdateInspectTemplateRequest request)
Updates the InspectTemplate.
|
UnaryCallable<com.google.privacy.dlp.v2.UpdateInspectTemplateRequest,com.google.privacy.dlp.v2.InspectTemplate> |
updateInspectTemplateCallable()
Updates the InspectTemplate.
|
com.google.privacy.dlp.v2.JobTrigger |
updateJobTrigger(com.google.privacy.dlp.v2.UpdateJobTriggerRequest request)
Updates a job trigger.
|
UnaryCallable<com.google.privacy.dlp.v2.UpdateJobTriggerRequest,com.google.privacy.dlp.v2.JobTrigger> |
updateJobTriggerCallable()
Updates a job trigger.
|
com.google.privacy.dlp.v2.StoredInfoType |
updateStoredInfoType(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest request)
Updates the stored infoType by creating a new version.
|
UnaryCallable<com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest,com.google.privacy.dlp.v2.StoredInfoType> |
updateStoredInfoTypeCallable()
Updates the stored infoType by creating a new version.
|
protected DlpServiceClient(DlpServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected DlpServiceClient(DlpServiceStub stub)
public static final DlpServiceClient create() throws IOException
IOException
public static final DlpServiceClient create(DlpServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final DlpServiceClient create(DlpServiceStub stub)
public final DlpServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public DlpServiceStub getStub()
public final com.google.privacy.dlp.v2.InspectContentResponse inspectContent(com.google.privacy.dlp.v2.InspectContentRequest request)
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
InspectContentRequest request = InspectContentRequest.newBuilder()
.setParent(parent.toString())
.build();
InspectContentResponse response = dlpServiceClient.inspectContent(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.InspectContentRequest,com.google.privacy.dlp.v2.InspectContentResponse> inspectContentCallable()
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
InspectContentRequest request = InspectContentRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<InspectContentResponse> future = dlpServiceClient.inspectContentCallable().futureCall(request);
// Do something
InspectContentResponse response = future.get();
}
public final com.google.privacy.dlp.v2.RedactImageResponse redactImage(com.google.privacy.dlp.v2.RedactImageRequest request)
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
RedactImageRequest request = RedactImageRequest.newBuilder()
.setParent(parent.toString())
.build();
RedactImageResponse response = dlpServiceClient.redactImage(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.RedactImageRequest,com.google.privacy.dlp.v2.RedactImageResponse> redactImageCallable()
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
RedactImageRequest request = RedactImageRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<RedactImageResponse> future = dlpServiceClient.redactImageCallable().futureCall(request);
// Do something
RedactImageResponse response = future.get();
}
public final com.google.privacy.dlp.v2.DeidentifyContentResponse deidentifyContent(com.google.privacy.dlp.v2.DeidentifyContentRequest request)
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
DeidentifyContentRequest request = DeidentifyContentRequest.newBuilder()
.setParent(parent.toString())
.build();
DeidentifyContentResponse response = dlpServiceClient.deidentifyContent(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.DeidentifyContentRequest,com.google.privacy.dlp.v2.DeidentifyContentResponse> deidentifyContentCallable()
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
DeidentifyContentRequest request = DeidentifyContentRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<DeidentifyContentResponse> future = dlpServiceClient.deidentifyContentCallable().futureCall(request);
// Do something
DeidentifyContentResponse response = future.get();
}
public final com.google.privacy.dlp.v2.ReidentifyContentResponse reidentifyContent(com.google.privacy.dlp.v2.ReidentifyContentRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ReidentifyContentRequest request = ReidentifyContentRequest.newBuilder()
.setParent(parent.toString())
.build();
ReidentifyContentResponse response = dlpServiceClient.reidentifyContent(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ReidentifyContentRequest,com.google.privacy.dlp.v2.ReidentifyContentResponse> reidentifyContentCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ReidentifyContentRequest request = ReidentifyContentRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ReidentifyContentResponse> future = dlpServiceClient.reidentifyContentCallable().futureCall(request);
// Do something
ReidentifyContentResponse response = future.get();
}
public final com.google.privacy.dlp.v2.ListInfoTypesResponse listInfoTypes(com.google.privacy.dlp.v2.ListInfoTypesRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ListInfoTypesRequest request = ListInfoTypesRequest.newBuilder().build();
ListInfoTypesResponse response = dlpServiceClient.listInfoTypes(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ListInfoTypesRequest,com.google.privacy.dlp.v2.ListInfoTypesResponse> listInfoTypesCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ListInfoTypesRequest request = ListInfoTypesRequest.newBuilder().build();
ApiFuture<ListInfoTypesResponse> future = dlpServiceClient.listInfoTypesCallable().futureCall(request);
// Do something
ListInfoTypesResponse response = future.get();
}
public final com.google.privacy.dlp.v2.InspectTemplate createInspectTemplate(com.google.privacy.dlp.v2.CreateInspectTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
CreateInspectTemplateRequest request = CreateInspectTemplateRequest.newBuilder()
.setParent(parent.toString())
.build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.CreateInspectTemplateRequest,com.google.privacy.dlp.v2.InspectTemplate> createInspectTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
CreateInspectTemplateRequest request = CreateInspectTemplateRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<InspectTemplate> future = dlpServiceClient.createInspectTemplateCallable().futureCall(request);
// Do something
InspectTemplate response = future.get();
}
public final com.google.privacy.dlp.v2.InspectTemplate updateInspectTemplate(com.google.privacy.dlp.v2.UpdateInspectTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
InspectTemplateName name = OrganizationInspectTemplateName.of("[ORGANIZATION]", "[INSPECT_TEMPLATE]");
UpdateInspectTemplateRequest request = UpdateInspectTemplateRequest.newBuilder()
.setName(name.toString())
.build();
InspectTemplate response = dlpServiceClient.updateInspectTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.UpdateInspectTemplateRequest,com.google.privacy.dlp.v2.InspectTemplate> updateInspectTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
InspectTemplateName name = OrganizationInspectTemplateName.of("[ORGANIZATION]", "[INSPECT_TEMPLATE]");
UpdateInspectTemplateRequest request = UpdateInspectTemplateRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<InspectTemplate> future = dlpServiceClient.updateInspectTemplateCallable().futureCall(request);
// Do something
InspectTemplate response = future.get();
}
public final com.google.privacy.dlp.v2.InspectTemplate getInspectTemplate(com.google.privacy.dlp.v2.GetInspectTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
GetInspectTemplateRequest request = GetInspectTemplateRequest.newBuilder().build();
InspectTemplate response = dlpServiceClient.getInspectTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.GetInspectTemplateRequest,com.google.privacy.dlp.v2.InspectTemplate> getInspectTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
GetInspectTemplateRequest request = GetInspectTemplateRequest.newBuilder().build();
ApiFuture<InspectTemplate> future = dlpServiceClient.getInspectTemplateCallable().futureCall(request);
// Do something
InspectTemplate response = future.get();
}
public final DlpServiceClient.ListInspectTemplatesPagedResponse listInspectTemplates(com.google.privacy.dlp.v2.ListInspectTemplatesRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListInspectTemplatesRequest request = ListInspectTemplatesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (InspectTemplate element : dlpServiceClient.listInspectTemplates(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ListInspectTemplatesRequest,DlpServiceClient.ListInspectTemplatesPagedResponse> listInspectTemplatesPagedCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListInspectTemplatesRequest request = ListInspectTemplatesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListInspectTemplatesPagedResponse> future = dlpServiceClient.listInspectTemplatesPagedCallable().futureCall(request);
// Do something
for (InspectTemplate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.privacy.dlp.v2.ListInspectTemplatesRequest,com.google.privacy.dlp.v2.ListInspectTemplatesResponse> listInspectTemplatesCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListInspectTemplatesRequest request = ListInspectTemplatesRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final void deleteInspectTemplate(com.google.privacy.dlp.v2.DeleteInspectTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
InspectTemplateName name = OrganizationInspectTemplateName.of("[ORGANIZATION]", "[INSPECT_TEMPLATE]");
DeleteInspectTemplateRequest request = DeleteInspectTemplateRequest.newBuilder()
.setName(name.toString())
.build();
dlpServiceClient.deleteInspectTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.DeleteInspectTemplateRequest,Empty> deleteInspectTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
InspectTemplateName name = OrganizationInspectTemplateName.of("[ORGANIZATION]", "[INSPECT_TEMPLATE]");
DeleteInspectTemplateRequest request = DeleteInspectTemplateRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dlpServiceClient.deleteInspectTemplateCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.privacy.dlp.v2.DeidentifyTemplate createDeidentifyTemplate(com.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
CreateDeidentifyTemplateRequest request = CreateDeidentifyTemplateRequest.newBuilder()
.setParent(parent.toString())
.build();
DeidentifyTemplate response = dlpServiceClient.createDeidentifyTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.CreateDeidentifyTemplateRequest,com.google.privacy.dlp.v2.DeidentifyTemplate> createDeidentifyTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
CreateDeidentifyTemplateRequest request = CreateDeidentifyTemplateRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<DeidentifyTemplate> future = dlpServiceClient.createDeidentifyTemplateCallable().futureCall(request);
// Do something
DeidentifyTemplate response = future.get();
}
public final com.google.privacy.dlp.v2.DeidentifyTemplate updateDeidentifyTemplate(com.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DeidentifyTemplateName name = OrganizationDeidentifyTemplateName.of("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
UpdateDeidentifyTemplateRequest request = UpdateDeidentifyTemplateRequest.newBuilder()
.setName(name.toString())
.build();
DeidentifyTemplate response = dlpServiceClient.updateDeidentifyTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.UpdateDeidentifyTemplateRequest,com.google.privacy.dlp.v2.DeidentifyTemplate> updateDeidentifyTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DeidentifyTemplateName name = OrganizationDeidentifyTemplateName.of("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
UpdateDeidentifyTemplateRequest request = UpdateDeidentifyTemplateRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<DeidentifyTemplate> future = dlpServiceClient.updateDeidentifyTemplateCallable().futureCall(request);
// Do something
DeidentifyTemplate response = future.get();
}
public final com.google.privacy.dlp.v2.DeidentifyTemplate getDeidentifyTemplate(com.google.privacy.dlp.v2.GetDeidentifyTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DeidentifyTemplateName name = OrganizationDeidentifyTemplateName.of("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
GetDeidentifyTemplateRequest request = GetDeidentifyTemplateRequest.newBuilder()
.setName(name.toString())
.build();
DeidentifyTemplate response = dlpServiceClient.getDeidentifyTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.GetDeidentifyTemplateRequest,com.google.privacy.dlp.v2.DeidentifyTemplate> getDeidentifyTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DeidentifyTemplateName name = OrganizationDeidentifyTemplateName.of("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
GetDeidentifyTemplateRequest request = GetDeidentifyTemplateRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<DeidentifyTemplate> future = dlpServiceClient.getDeidentifyTemplateCallable().futureCall(request);
// Do something
DeidentifyTemplate response = future.get();
}
public final DlpServiceClient.ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(com.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListDeidentifyTemplatesRequest request = ListDeidentifyTemplatesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (DeidentifyTemplate element : dlpServiceClient.listDeidentifyTemplates(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest,DlpServiceClient.ListDeidentifyTemplatesPagedResponse> listDeidentifyTemplatesPagedCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListDeidentifyTemplatesRequest request = ListDeidentifyTemplatesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListDeidentifyTemplatesPagedResponse> future = dlpServiceClient.listDeidentifyTemplatesPagedCallable().futureCall(request);
// Do something
for (DeidentifyTemplate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.privacy.dlp.v2.ListDeidentifyTemplatesRequest,com.google.privacy.dlp.v2.ListDeidentifyTemplatesResponse> listDeidentifyTemplatesCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListDeidentifyTemplatesRequest request = ListDeidentifyTemplatesRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final void deleteDeidentifyTemplate(com.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DeidentifyTemplateName name = OrganizationDeidentifyTemplateName.of("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
DeleteDeidentifyTemplateRequest request = DeleteDeidentifyTemplateRequest.newBuilder()
.setName(name.toString())
.build();
dlpServiceClient.deleteDeidentifyTemplate(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.DeleteDeidentifyTemplateRequest,Empty> deleteDeidentifyTemplateCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DeidentifyTemplateName name = OrganizationDeidentifyTemplateName.of("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
DeleteDeidentifyTemplateRequest request = DeleteDeidentifyTemplateRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dlpServiceClient.deleteDeidentifyTemplateCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.privacy.dlp.v2.DlpJob createDlpJob(com.google.privacy.dlp.v2.CreateDlpJobRequest request)
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
CreateDlpJobRequest request = CreateDlpJobRequest.newBuilder()
.setParent(parent.toString())
.build();
DlpJob response = dlpServiceClient.createDlpJob(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.CreateDlpJobRequest,com.google.privacy.dlp.v2.DlpJob> createDlpJobCallable()
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:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
CreateDlpJobRequest request = CreateDlpJobRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<DlpJob> future = dlpServiceClient.createDlpJobCallable().futureCall(request);
// Do something
DlpJob response = future.get();
}
public final DlpServiceClient.ListDlpJobsPagedResponse listDlpJobs(com.google.privacy.dlp.v2.ListDlpJobsRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListDlpJobsRequest request = ListDlpJobsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (DlpJob element : dlpServiceClient.listDlpJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ListDlpJobsRequest,DlpServiceClient.ListDlpJobsPagedResponse> listDlpJobsPagedCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListDlpJobsRequest request = ListDlpJobsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListDlpJobsPagedResponse> future = dlpServiceClient.listDlpJobsPagedCallable().futureCall(request);
// Do something
for (DlpJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.privacy.dlp.v2.ListDlpJobsRequest,com.google.privacy.dlp.v2.ListDlpJobsResponse> listDlpJobsCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListDlpJobsRequest request = ListDlpJobsRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final com.google.privacy.dlp.v2.DlpJob getDlpJob(com.google.privacy.dlp.v2.GetDlpJobRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DlpJobName name = DlpJobName.of("[PROJECT]", "[DLP_JOB]");
GetDlpJobRequest request = GetDlpJobRequest.newBuilder()
.setName(name.toString())
.build();
DlpJob response = dlpServiceClient.getDlpJob(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.GetDlpJobRequest,com.google.privacy.dlp.v2.DlpJob> getDlpJobCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DlpJobName name = DlpJobName.of("[PROJECT]", "[DLP_JOB]");
GetDlpJobRequest request = GetDlpJobRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<DlpJob> future = dlpServiceClient.getDlpJobCallable().futureCall(request);
// Do something
DlpJob response = future.get();
}
public final void deleteDlpJob(com.google.privacy.dlp.v2.DeleteDlpJobRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DlpJobName name = DlpJobName.of("[PROJECT]", "[DLP_JOB]");
DeleteDlpJobRequest request = DeleteDlpJobRequest.newBuilder()
.setName(name.toString())
.build();
dlpServiceClient.deleteDlpJob(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.DeleteDlpJobRequest,Empty> deleteDlpJobCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DlpJobName name = DlpJobName.of("[PROJECT]", "[DLP_JOB]");
DeleteDlpJobRequest request = DeleteDlpJobRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dlpServiceClient.deleteDlpJobCallable().futureCall(request);
// Do something
future.get();
}
public final void cancelDlpJob(com.google.privacy.dlp.v2.CancelDlpJobRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DlpJobName name = DlpJobName.of("[PROJECT]", "[DLP_JOB]");
CancelDlpJobRequest request = CancelDlpJobRequest.newBuilder()
.setName(name.toString())
.build();
dlpServiceClient.cancelDlpJob(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.CancelDlpJobRequest,Empty> cancelDlpJobCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
DlpJobName name = DlpJobName.of("[PROJECT]", "[DLP_JOB]");
CancelDlpJobRequest request = CancelDlpJobRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dlpServiceClient.cancelDlpJobCallable().futureCall(request);
// Do something
future.get();
}
public final DlpServiceClient.ListJobTriggersPagedResponse listJobTriggers(com.google.privacy.dlp.v2.ListJobTriggersRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListJobTriggersRequest request = ListJobTriggersRequest.newBuilder()
.setParent(parent.toString())
.build();
for (JobTrigger element : dlpServiceClient.listJobTriggers(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ListJobTriggersRequest,DlpServiceClient.ListJobTriggersPagedResponse> listJobTriggersPagedCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListJobTriggersRequest request = ListJobTriggersRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListJobTriggersPagedResponse> future = dlpServiceClient.listJobTriggersPagedCallable().futureCall(request);
// Do something
for (JobTrigger element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.privacy.dlp.v2.ListJobTriggersRequest,com.google.privacy.dlp.v2.ListJobTriggersResponse> listJobTriggersCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ListJobTriggersRequest request = ListJobTriggersRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final com.google.privacy.dlp.v2.JobTrigger getJobTrigger(com.google.privacy.dlp.v2.GetJobTriggerRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectJobTriggerName name = ProjectJobTriggerName.of("[PROJECT]", "[JOB_TRIGGER]");
GetJobTriggerRequest request = GetJobTriggerRequest.newBuilder()
.setName(name.toString())
.build();
JobTrigger response = dlpServiceClient.getJobTrigger(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.GetJobTriggerRequest,com.google.privacy.dlp.v2.JobTrigger> getJobTriggerCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectJobTriggerName name = ProjectJobTriggerName.of("[PROJECT]", "[JOB_TRIGGER]");
GetJobTriggerRequest request = GetJobTriggerRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<JobTrigger> future = dlpServiceClient.getJobTriggerCallable().futureCall(request);
// Do something
JobTrigger response = future.get();
}
public final void deleteJobTrigger(com.google.privacy.dlp.v2.DeleteJobTriggerRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectJobTriggerName name = ProjectJobTriggerName.of("[PROJECT]", "[JOB_TRIGGER]");
DeleteJobTriggerRequest request = DeleteJobTriggerRequest.newBuilder()
.setName(name.toString())
.build();
dlpServiceClient.deleteJobTrigger(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.DeleteJobTriggerRequest,Empty> deleteJobTriggerCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectJobTriggerName name = ProjectJobTriggerName.of("[PROJECT]", "[JOB_TRIGGER]");
DeleteJobTriggerRequest request = DeleteJobTriggerRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dlpServiceClient.deleteJobTriggerCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.privacy.dlp.v2.JobTrigger updateJobTrigger(com.google.privacy.dlp.v2.UpdateJobTriggerRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectJobTriggerName name = ProjectJobTriggerName.of("[PROJECT]", "[JOB_TRIGGER]");
UpdateJobTriggerRequest request = UpdateJobTriggerRequest.newBuilder()
.setName(name.toString())
.build();
JobTrigger response = dlpServiceClient.updateJobTrigger(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.UpdateJobTriggerRequest,com.google.privacy.dlp.v2.JobTrigger> updateJobTriggerCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectJobTriggerName name = ProjectJobTriggerName.of("[PROJECT]", "[JOB_TRIGGER]");
UpdateJobTriggerRequest request = UpdateJobTriggerRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<JobTrigger> future = dlpServiceClient.updateJobTriggerCallable().futureCall(request);
// Do something
JobTrigger response = future.get();
}
public final com.google.privacy.dlp.v2.JobTrigger createJobTrigger(com.google.privacy.dlp.v2.CreateJobTriggerRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
CreateJobTriggerRequest request = CreateJobTriggerRequest.newBuilder()
.setParent(parent.toString())
.build();
JobTrigger response = dlpServiceClient.createJobTrigger(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.CreateJobTriggerRequest,com.google.privacy.dlp.v2.JobTrigger> createJobTriggerCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
CreateJobTriggerRequest request = CreateJobTriggerRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<JobTrigger> future = dlpServiceClient.createJobTriggerCallable().futureCall(request);
// Do something
JobTrigger response = future.get();
}
public final com.google.privacy.dlp.v2.StoredInfoType createStoredInfoType(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
CreateStoredInfoTypeRequest request = CreateStoredInfoTypeRequest.newBuilder()
.setParent(parent.toString())
.build();
StoredInfoType response = dlpServiceClient.createStoredInfoType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest,com.google.privacy.dlp.v2.StoredInfoType> createStoredInfoTypeCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
CreateStoredInfoTypeRequest request = CreateStoredInfoTypeRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<StoredInfoType> future = dlpServiceClient.createStoredInfoTypeCallable().futureCall(request);
// Do something
StoredInfoType response = future.get();
}
public final com.google.privacy.dlp.v2.StoredInfoType updateStoredInfoType(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
StoredInfoTypeName name = OrganizationStoredInfoTypeName.of("[ORGANIZATION]", "[STORED_INFO_TYPE]");
UpdateStoredInfoTypeRequest request = UpdateStoredInfoTypeRequest.newBuilder()
.setName(name.toString())
.build();
StoredInfoType response = dlpServiceClient.updateStoredInfoType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest,com.google.privacy.dlp.v2.StoredInfoType> updateStoredInfoTypeCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
StoredInfoTypeName name = OrganizationStoredInfoTypeName.of("[ORGANIZATION]", "[STORED_INFO_TYPE]");
UpdateStoredInfoTypeRequest request = UpdateStoredInfoTypeRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<StoredInfoType> future = dlpServiceClient.updateStoredInfoTypeCallable().futureCall(request);
// Do something
StoredInfoType response = future.get();
}
public final com.google.privacy.dlp.v2.StoredInfoType getStoredInfoType(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
StoredInfoTypeName name = OrganizationStoredInfoTypeName.of("[ORGANIZATION]", "[STORED_INFO_TYPE]");
GetStoredInfoTypeRequest request = GetStoredInfoTypeRequest.newBuilder()
.setName(name.toString())
.build();
StoredInfoType response = dlpServiceClient.getStoredInfoType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.GetStoredInfoTypeRequest,com.google.privacy.dlp.v2.StoredInfoType> getStoredInfoTypeCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
StoredInfoTypeName name = OrganizationStoredInfoTypeName.of("[ORGANIZATION]", "[STORED_INFO_TYPE]");
GetStoredInfoTypeRequest request = GetStoredInfoTypeRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<StoredInfoType> future = dlpServiceClient.getStoredInfoTypeCallable().futureCall(request);
// Do something
StoredInfoType response = future.get();
}
public final DlpServiceClient.ListStoredInfoTypesPagedResponse listStoredInfoTypes(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListStoredInfoTypesRequest request = ListStoredInfoTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (StoredInfoType element : dlpServiceClient.listStoredInfoTypes(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.ListStoredInfoTypesRequest,DlpServiceClient.ListStoredInfoTypesPagedResponse> listStoredInfoTypesPagedCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListStoredInfoTypesRequest request = ListStoredInfoTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListStoredInfoTypesPagedResponse> future = dlpServiceClient.listStoredInfoTypesPagedCallable().futureCall(request);
// Do something
for (StoredInfoType element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.privacy.dlp.v2.ListStoredInfoTypesRequest,com.google.privacy.dlp.v2.ListStoredInfoTypesResponse> listStoredInfoTypesCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
ListStoredInfoTypesRequest request = ListStoredInfoTypesRequest.newBuilder()
.setParent(parent.toString())
.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;
}
}
}
public final void deleteStoredInfoType(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest request)
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
StoredInfoTypeName name = OrganizationStoredInfoTypeName.of("[ORGANIZATION]", "[STORED_INFO_TYPE]");
DeleteStoredInfoTypeRequest request = DeleteStoredInfoTypeRequest.newBuilder()
.setName(name.toString())
.build();
dlpServiceClient.deleteStoredInfoType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest,Empty> deleteStoredInfoTypeCallable()
Sample code:
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
StoredInfoTypeName name = OrganizationStoredInfoTypeName.of("[ORGANIZATION]", "[STORED_INFO_TYPE]");
DeleteStoredInfoTypeRequest request = DeleteStoredInfoTypeRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = dlpServiceClient.deleteStoredInfoTypeCallable().futureCall(request);
// Do something
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.