use of com.google.cloud.talent.v4.GetJobRequest in project java-docs-samples by GoogleCloudPlatform.
the class JobSearchGetJob method getJob.
// Get Job.
public static void getJob(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);
GetJobRequest request = GetJobRequest.newBuilder().setName(name.toString()).build();
Job response = jobServiceClient.getJob(request);
System.out.format("Job name: %s%n", response.getName());
System.out.format("Requisition ID: %s%n", response.getRequisitionId());
System.out.format("Title: %s%n", response.getTitle());
System.out.format("Description: %s%n", response.getDescription());
System.out.format("Posting language: %s%n", response.getLanguageCode());
for (String address : response.getAddressesList()) {
System.out.format("Address: %s%n", address);
}
for (String email : response.getApplicationInfo().getEmailsList()) {
System.out.format("Email: %s%n", email);
}
for (String websiteUri : response.getApplicationInfo().getUrisList()) {
System.out.format("Website: %s%n", websiteUri);
}
}
}
use of com.google.cloud.talent.v4.GetJobRequest in project java-talent by googleapis.
the class ITSystemTest method getJobTest.
@Test
public void getJobTest() {
GetJobRequest request = GetJobRequest.newBuilder().setName(jobName.toString()).build();
Job actual = jobServiceClient.getJob(request);
assertEquals(job.getName(), actual.getName());
assertEquals(job.getCompany(), actual.getCompany());
assertEquals(job.getRequisitionId(), actual.getRequisitionId());
assertEquals(job.getTitle(), actual.getTitle());
assertEquals(job.getDescription(), actual.getDescription());
assertEquals(job.getApplicationInfo(), actual.getApplicationInfo());
assertEquals(job.getAddressesCount(), actual.getAddressesCount());
assertEquals(job.getLanguageCode(), actual.getLanguageCode());
}
use of com.google.cloud.talent.v4.GetJobRequest in project java-talent by googleapis.
the class JobSearchGetJob method getJob.
// Get Job.
public static void getJob(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);
GetJobRequest request = GetJobRequest.newBuilder().setName(name.toString()).build();
Job response = jobServiceClient.getJob(request);
System.out.format("Job name: %s%n", response.getName());
System.out.format("Requisition ID: %s%n", response.getRequisitionId());
System.out.format("Title: %s%n", response.getTitle());
System.out.format("Description: %s%n", response.getDescription());
System.out.format("Posting language: %s%n", response.getLanguageCode());
for (String address : response.getAddressesList()) {
System.out.format("Address: %s%n", address);
}
for (String email : response.getApplicationInfo().getEmailsList()) {
System.out.format("Email: %s%n", email);
}
for (String websiteUri : response.getApplicationInfo().getUrisList()) {
System.out.format("Website: %s%n", websiteUri);
}
}
}
use of com.google.cloud.talent.v4.GetJobRequest in project java-talent by googleapis.
the class JobSearchGetJob method sampleGetJob.
/**
* Get Job
*/
public static void sampleGetJob(String projectId, String tenantId, String jobId) {
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
JobName name = JobWithTenantName.of(projectId, tenantId, jobId);
GetJobRequest request = GetJobRequest.newBuilder().setName(name.toString()).build();
Job response = jobServiceClient.getJob(request);
System.out.printf("Job name: %s\n", response.getName());
System.out.printf("Requisition ID: %s\n", response.getRequisitionId());
System.out.printf("Title: %s\n", response.getTitle());
System.out.printf("Description: %s\n", response.getDescription());
System.out.printf("Posting language: %s\n", response.getLanguageCode());
for (String address : response.getAddressesList()) {
System.out.printf("Address: %s\n", address);
}
for (String email : response.getApplicationInfo().getEmailsList()) {
System.out.printf("Email: %s\n", email);
}
for (String websiteUri : response.getApplicationInfo().getUrisList()) {
System.out.printf("Website: %s\n", websiteUri);
}
} catch (Exception exception) {
System.err.println("Failed to create the client due to: " + exception);
}
}
Aggregations