Search in sources :

Example 1 with DeleteJobRequest

use of com.google.cloud.talent.v4beta1.DeleteJobRequest in project java-docs-samples by GoogleCloudPlatform.

the class JobSearchDeleteJob method deleteJob.

// Delete Job.
public static void deleteJob(String projectId, String tenantId, String jobId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
        JobName name = JobName.ofProjectTenantJobName(projectId, tenantId, jobId);
        DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name.toString()).build();
        jobServiceClient.deleteJob(request);
        System.out.println("Deleted job.");
    }
}
Also used : DeleteJobRequest(com.google.cloud.talent.v4beta1.DeleteJobRequest) JobName(com.google.cloud.talent.v4beta1.JobName) JobServiceClient(com.google.cloud.talent.v4beta1.JobServiceClient)

Aggregations

DeleteJobRequest (com.google.cloud.talent.v4beta1.DeleteJobRequest)1 JobName (com.google.cloud.talent.v4beta1.JobName)1 JobServiceClient (com.google.cloud.talent.v4beta1.JobServiceClient)1