use of com.google.cloud.talent.v4.DeleteJobRequest in project java-talent by googleapis.
the class JobSearchDeleteJob method sampleDeleteJob.
/**
* Delete Job
*/
public static void sampleDeleteJob(String projectId, String tenantId, String jobId) {
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
JobName name = JobWithTenantName.of(projectId, tenantId, jobId);
DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name.toString()).build();
jobServiceClient.deleteJob(request);
System.out.println("Deleted job.");
} catch (Exception exception) {
System.err.println("Failed to create the client due to: " + exception);
}
}
use of com.google.cloud.talent.v4.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.");
}
}
use of com.google.cloud.talent.v4.DeleteJobRequest in project java-talent by googleapis.
the class ITSystemTest method afterTest.
@AfterClass
public static void afterTest() {
completionClient.close();
eventServiceClient.close();
/* delete job */
DeleteJobRequest jobRequest = DeleteJobRequest.newBuilder().setName(jobName.toString()).build();
jobServiceClient.deleteJob(jobRequest);
jobServiceClient.close();
/* delete company */
DeleteCompanyRequest companyRequest = DeleteCompanyRequest.newBuilder().setName(companyName.toString()).build();
companyServiceClient.deleteCompany(companyRequest);
companyServiceClient.close();
/* delete tenant */
DeleteTenantRequest request = DeleteTenantRequest.newBuilder().setName(tenantName.toString()).build();
tenantServiceClient.deleteTenant(request);
tenantServiceClient.close();
}
use of com.google.cloud.talent.v4.DeleteJobRequest in project java-talent by googleapis.
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.of(projectId, tenantId, jobId);
DeleteJobRequest request = DeleteJobRequest.newBuilder().setName(name.toString()).build();
jobServiceClient.deleteJob(request);
System.out.println("Deleted job.");
}
}
Aggregations