Search in sources :

Example 1 with BatchDeleteJobsRequest

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);
    }
}
Also used : BatchDeleteJobsRequest(com.google.cloud.talent.v4beta1.BatchDeleteJobsRequest) JobServiceClient(com.google.cloud.talent.v4beta1.JobServiceClient) TenantOrProjectName(com.google.cloud.talent.v4beta1.TenantOrProjectName)

Aggregations

BatchDeleteJobsRequest (com.google.cloud.talent.v4beta1.BatchDeleteJobsRequest)1 JobServiceClient (com.google.cloud.talent.v4beta1.JobServiceClient)1 TenantOrProjectName (com.google.cloud.talent.v4beta1.TenantOrProjectName)1