@Generated(value="by gapic-generator") @BetaApi public class DlpServiceClient extends Object implements com.google.api.gax.core.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(CancelDlpJobRequest request)
Starts asynchronous cancellation on a long-running DlpJob.
|
com.google.api.gax.rpc.UnaryCallable<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.
|
DeidentifyTemplate |
createDeidentifyTemplate(CreateDeidentifyTemplateRequest request)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying
content, images, and storage.
|
com.google.api.gax.rpc.UnaryCallable<CreateDeidentifyTemplateRequest,DeidentifyTemplate> |
createDeidentifyTemplateCallable()
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying
content, images, and storage.
|
DlpJob |
createDlpJob(CreateDlpJobRequest request)
Creates a new job to inspect storage or calculate risk metrics.
|
com.google.api.gax.rpc.UnaryCallable<CreateDlpJobRequest,DlpJob> |
createDlpJobCallable()
Creates a new job to inspect storage or calculate risk metrics.
|
InspectTemplate |
createInspectTemplate(CreateInspectTemplateRequest request)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content,
images, and storage.
|
com.google.api.gax.rpc.UnaryCallable<CreateInspectTemplateRequest,InspectTemplate> |
createInspectTemplateCallable()
Creates an InspectTemplate for re-using frequently used configuration for inspecting content,
images, and storage.
|
JobTrigger |
createJobTrigger(CreateJobTriggerRequest request)
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on
a set schedule.
|
com.google.api.gax.rpc.UnaryCallable<CreateJobTriggerRequest,JobTrigger> |
createJobTriggerCallable()
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on
a set schedule.
|
StoredInfoType |
createStoredInfoType(CreateStoredInfoTypeRequest request)
Creates a pre-built stored infoType to be used for inspection.
|
com.google.api.gax.rpc.UnaryCallable<CreateStoredInfoTypeRequest,StoredInfoType> |
createStoredInfoTypeCallable()
Creates a pre-built stored infoType to be used for inspection.
|
DeidentifyContentResponse |
deidentifyContent(DeidentifyContentRequest request)
De-identifies potentially sensitive info from a ContentItem.
|
com.google.api.gax.rpc.UnaryCallable<DeidentifyContentRequest,DeidentifyContentResponse> |
deidentifyContentCallable()
De-identifies potentially sensitive info from a ContentItem.
|
void |
deleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest request)
Deletes a DeidentifyTemplate.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDeidentifyTemplateRequest,Empty> |
deleteDeidentifyTemplateCallable()
Deletes a DeidentifyTemplate.
|
void |
deleteDlpJob(DeleteDlpJobRequest request)
Deletes a long-running DlpJob.
|
com.google.api.gax.rpc.UnaryCallable<DeleteDlpJobRequest,Empty> |
deleteDlpJobCallable()
Deletes a long-running DlpJob.
|
void |
deleteInspectTemplate(DeleteInspectTemplateRequest request)
Deletes an InspectTemplate.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInspectTemplateRequest,Empty> |
deleteInspectTemplateCallable()
Deletes an InspectTemplate.
|
void |
deleteJobTrigger(DeleteJobTriggerRequest request)
Deletes a job trigger.
|
com.google.api.gax.rpc.UnaryCallable<DeleteJobTriggerRequest,Empty> |
deleteJobTriggerCallable()
Deletes a job trigger.
|
void |
deleteStoredInfoType(DeleteStoredInfoTypeRequest request)
Deletes a stored infoType.
|
com.google.api.gax.rpc.UnaryCallable<DeleteStoredInfoTypeRequest,Empty> |
deleteStoredInfoTypeCallable()
Deletes a stored infoType.
|
DeidentifyTemplate |
getDeidentifyTemplate(GetDeidentifyTemplateRequest request)
Gets a DeidentifyTemplate.
|
com.google.api.gax.rpc.UnaryCallable<GetDeidentifyTemplateRequest,DeidentifyTemplate> |
getDeidentifyTemplateCallable()
Gets a DeidentifyTemplate.
|
DlpJob |
getDlpJob(GetDlpJobRequest request)
Gets the latest state of a long-running DlpJob.
|
com.google.api.gax.rpc.UnaryCallable<GetDlpJobRequest,DlpJob> |
getDlpJobCallable()
Gets the latest state of a long-running DlpJob.
|
InspectTemplate |
getInspectTemplate(GetInspectTemplateRequest request)
Gets an InspectTemplate.
|
com.google.api.gax.rpc.UnaryCallable<GetInspectTemplateRequest,InspectTemplate> |
getInspectTemplateCallable()
Gets an InspectTemplate.
|
JobTrigger |
getJobTrigger(GetJobTriggerRequest request)
Gets a job trigger.
|
com.google.api.gax.rpc.UnaryCallable<GetJobTriggerRequest,JobTrigger> |
getJobTriggerCallable()
Gets a job trigger.
|
DlpServiceSettings |
getSettings() |
StoredInfoType |
getStoredInfoType(GetStoredInfoTypeRequest request)
Gets a stored infoType.
|
com.google.api.gax.rpc.UnaryCallable<GetStoredInfoTypeRequest,StoredInfoType> |
getStoredInfoTypeCallable()
Gets a stored infoType.
|
DlpServiceStub |
getStub() |
InspectContentResponse |
inspectContent(InspectContentRequest request)
Finds potentially sensitive info in content.
|
com.google.api.gax.rpc.UnaryCallable<InspectContentRequest,InspectContentResponse> |
inspectContentCallable()
Finds potentially sensitive info in content.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
DlpServiceClient.ListDeidentifyTemplatesPagedResponse |
listDeidentifyTemplates(ListDeidentifyTemplatesRequest request)
Lists DeidentifyTemplates.
|
com.google.api.gax.rpc.UnaryCallable<ListDeidentifyTemplatesRequest,ListDeidentifyTemplatesResponse> |
listDeidentifyTemplatesCallable()
Lists DeidentifyTemplates.
|
com.google.api.gax.rpc.UnaryCallable<ListDeidentifyTemplatesRequest,DlpServiceClient.ListDeidentifyTemplatesPagedResponse> |
listDeidentifyTemplatesPagedCallable()
Lists DeidentifyTemplates.
|
DlpServiceClient.ListDlpJobsPagedResponse |
listDlpJobs(ListDlpJobsRequest request)
Lists DlpJobs that match the specified filter in the request.
|
com.google.api.gax.rpc.UnaryCallable<ListDlpJobsRequest,ListDlpJobsResponse> |
listDlpJobsCallable()
Lists DlpJobs that match the specified filter in the request.
|
com.google.api.gax.rpc.UnaryCallable<ListDlpJobsRequest,DlpServiceClient.ListDlpJobsPagedResponse> |
listDlpJobsPagedCallable()
Lists DlpJobs that match the specified filter in the request.
|
ListInfoTypesResponse |
listInfoTypes(ListInfoTypesRequest request)
Returns a list of the sensitive information types that the DLP API supports.
|
com.google.api.gax.rpc.UnaryCallable<ListInfoTypesRequest,ListInfoTypesResponse> |
listInfoTypesCallable()
Returns a list of the sensitive information types that the DLP API supports.
|
DlpServiceClient.ListInspectTemplatesPagedResponse |
listInspectTemplates(ListInspectTemplatesRequest request)
Lists InspectTemplates.
|
com.google.api.gax.rpc.UnaryCallable<ListInspectTemplatesRequest,ListInspectTemplatesResponse> |
listInspectTemplatesCallable()
Lists InspectTemplates.
|
com.google.api.gax.rpc.UnaryCallable<ListInspectTemplatesRequest,DlpServiceClient.ListInspectTemplatesPagedResponse> |
listInspectTemplatesPagedCallable()
Lists InspectTemplates.
|
DlpServiceClient.ListJobTriggersPagedResponse |
listJobTriggers(ListJobTriggersRequest request)
Lists job triggers.
|
com.google.api.gax.rpc.UnaryCallable<ListJobTriggersRequest,ListJobTriggersResponse> |
listJobTriggersCallable()
Lists job triggers.
|
com.google.api.gax.rpc.UnaryCallable<ListJobTriggersRequest,DlpServiceClient.ListJobTriggersPagedResponse> |
listJobTriggersPagedCallable()
Lists job triggers.
|
DlpServiceClient.ListStoredInfoTypesPagedResponse |
listStoredInfoTypes(ListStoredInfoTypesRequest request)
Lists stored infoTypes.
|
com.google.api.gax.rpc.UnaryCallable<ListStoredInfoTypesRequest,ListStoredInfoTypesResponse> |
listStoredInfoTypesCallable()
Lists stored infoTypes.
|
com.google.api.gax.rpc.UnaryCallable<ListStoredInfoTypesRequest,DlpServiceClient.ListStoredInfoTypesPagedResponse> |
listStoredInfoTypesPagedCallable()
Lists stored infoTypes.
|
RedactImageResponse |
redactImage(RedactImageRequest request)
Redacts potentially sensitive info from an image.
|
com.google.api.gax.rpc.UnaryCallable<RedactImageRequest,RedactImageResponse> |
redactImageCallable()
Redacts potentially sensitive info from an image.
|
ReidentifyContentResponse |
reidentifyContent(ReidentifyContentRequest request)
Re-identifies content that has been de-identified.
|
com.google.api.gax.rpc.UnaryCallable<ReidentifyContentRequest,ReidentifyContentResponse> |
reidentifyContentCallable()
Re-identifies content that has been de-identified.
|
void |
shutdown() |
void |
shutdownNow() |
DeidentifyTemplate |
updateDeidentifyTemplate(UpdateDeidentifyTemplateRequest request)
Updates the DeidentifyTemplate.
|
com.google.api.gax.rpc.UnaryCallable<UpdateDeidentifyTemplateRequest,DeidentifyTemplate> |
updateDeidentifyTemplateCallable()
Updates the DeidentifyTemplate.
|
InspectTemplate |
updateInspectTemplate(UpdateInspectTemplateRequest request)
Updates the InspectTemplate.
|
com.google.api.gax.rpc.UnaryCallable<UpdateInspectTemplateRequest,InspectTemplate> |
updateInspectTemplateCallable()
Updates the InspectTemplate.
|
JobTrigger |
updateJobTrigger(UpdateJobTriggerRequest request)
Updates a job trigger.
|
com.google.api.gax.rpc.UnaryCallable<UpdateJobTriggerRequest,JobTrigger> |
updateJobTriggerCallable()
Updates a job trigger.
|
StoredInfoType |
updateStoredInfoType(UpdateStoredInfoTypeRequest request)
Updates the stored infoType by creating a new version.
|
com.google.api.gax.rpc.UnaryCallable<UpdateStoredInfoTypeRequest,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 InspectContentResponse inspectContent(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<InspectContentRequest,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 RedactImageResponse redactImage(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RedactImageRequest,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 DeidentifyContentResponse deidentifyContent(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeidentifyContentRequest,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 ReidentifyContentResponse reidentifyContent(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ReidentifyContentRequest,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 ListInfoTypesResponse listInfoTypes(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListInfoTypesRequest,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 InspectTemplate createInspectTemplate(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateInspectTemplateRequest,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 InspectTemplate updateInspectTemplate(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateInspectTemplateRequest,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 InspectTemplate getInspectTemplate(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetInspectTemplateRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 com.google.api.gax.rpc.UnaryCallable<ListInspectTemplatesRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 DeidentifyTemplate createDeidentifyTemplate(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDeidentifyTemplateRequest,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 DeidentifyTemplate updateDeidentifyTemplate(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateDeidentifyTemplateRequest,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 DeidentifyTemplate getDeidentifyTemplate(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDeidentifyTemplateRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 com.google.api.gax.rpc.UnaryCallable<ListDeidentifyTemplatesRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 DlpJob createDlpJob(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateDlpJobRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 com.google.api.gax.rpc.UnaryCallable<ListDlpJobsRequest,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 DlpJob getDlpJob(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetDlpJobRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 com.google.api.gax.rpc.UnaryCallable<ListJobTriggersRequest,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 JobTrigger getJobTrigger(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetJobTriggerRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 JobTrigger updateJobTrigger(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateJobTriggerRequest,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 JobTrigger createJobTrigger(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateJobTriggerRequest,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 StoredInfoType createStoredInfoType(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateStoredInfoTypeRequest,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 StoredInfoType updateStoredInfoType(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateStoredInfoTypeRequest,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 StoredInfoType getStoredInfoType(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetStoredInfoTypeRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 com.google.api.gax.rpc.UnaryCallable<ListStoredInfoTypesRequest,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(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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<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 com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.