Search in sources :

Example 1 with ListJobsRequest

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

the class JobSearchListJobs method listJobs.

// Search Jobs with histogram queries.
public static void listJobs(String projectId, String tenantId, String filter) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
        TenantName parent = TenantName.of(projectId, tenantId);
        ListJobsRequest request = ListJobsRequest.newBuilder().setParent(parent.toString()).setFilter(filter).build();
        for (Job responseItem : jobServiceClient.listJobs(request).iterateAll()) {
            System.out.format("Job name: %s%n", responseItem.getName());
            System.out.format("Job requisition ID: %s%n", responseItem.getRequisitionId());
            System.out.format("Job title: %s%n", responseItem.getTitle());
            System.out.format("Job description: %s%n", responseItem.getDescription());
        }
    }
}
Also used : ListJobsRequest(com.google.cloud.talent.v4beta1.ListJobsRequest) TenantName(com.google.cloud.talent.v4beta1.TenantName) JobServiceClient(com.google.cloud.talent.v4beta1.JobServiceClient) Job(com.google.cloud.talent.v4beta1.Job)

Aggregations

Job (com.google.cloud.talent.v4beta1.Job)1 JobServiceClient (com.google.cloud.talent.v4beta1.JobServiceClient)1 ListJobsRequest (com.google.cloud.talent.v4beta1.ListJobsRequest)1 TenantName (com.google.cloud.talent.v4beta1.TenantName)1