Search in sources :

Example 1 with GetJobRequest

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

Example 2 with GetJobRequest

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());
}
Also used : GetJobRequest(com.google.cloud.talent.v4beta1.GetJobRequest) Job(com.google.cloud.talent.v4beta1.Job) Test(org.junit.Test)

Example 3 with GetJobRequest

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);
        }
    }
}
Also used : GetJobRequest(com.google.cloud.talent.v4.GetJobRequest) JobName(com.google.cloud.talent.v4.JobName) JobServiceClient(com.google.cloud.talent.v4.JobServiceClient) Job(com.google.cloud.talent.v4.Job)

Example 4 with GetJobRequest

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

Aggregations

GetJobRequest (com.google.cloud.talent.v4beta1.GetJobRequest)3 Job (com.google.cloud.talent.v4beta1.Job)3 JobName (com.google.cloud.talent.v4beta1.JobName)2 JobServiceClient (com.google.cloud.talent.v4beta1.JobServiceClient)2 GetJobRequest (com.google.cloud.talent.v4.GetJobRequest)1 Job (com.google.cloud.talent.v4.Job)1 JobName (com.google.cloud.talent.v4.JobName)1 JobServiceClient (com.google.cloud.talent.v4.JobServiceClient)1 Test (org.junit.Test)1