use of com.google.cloud.talent.v4beta1.ListCompaniesRequest in project java-docs-samples by GoogleCloudPlatform.
the class JobSearchListCompanies method listCompanies.
// List Companies.
public static void listCompanies(String projectId, String tenantId) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
TenantName parent = TenantName.of(projectId, tenantId);
ListCompaniesRequest request = ListCompaniesRequest.newBuilder().setParent(parent.toString()).build();
for (Company responseItem : companyServiceClient.listCompanies(request).iterateAll()) {
System.out.format("Company Name: %s%n", responseItem.getName());
System.out.format("Display Name: %s%n", responseItem.getDisplayName());
System.out.format("External ID: %s%n", responseItem.getExternalId());
}
}
}
Aggregations