use of com.google.cloud.talent.v4beta1.BatchDeleteJobsRequest in project java-talent by googleapis.
the class JobSearchBatchDeleteJob method sampleBatchDeleteJobs.
/**
* Batch delete jobs using a filter
*
* @param projectId Your Google Cloud Project ID
* @param tenantId Identifier of the Tenantd
* @param filter The filter string specifies the jobs to be deleted. For example: companyName =
* "projects/api-test-project/companies/123" AND equisitionId = "req-1"
*/
public static void sampleBatchDeleteJobs(String projectId, String tenantId, String filter) {
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
TenantOrProjectName parent = TenantName.of(projectId, tenantId);
BatchDeleteJobsRequest request = BatchDeleteJobsRequest.newBuilder().setParent(parent.toString()).setFilter(filter).build();
jobServiceClient.batchDeleteJobs(request);
System.out.println("Batch deleted jobs from filter");
} catch (Exception exception) {
System.err.println("Failed to create the client due to: " + exception);
}
}
Aggregations