use of com.google.cloud.talent.v4.ListTenantsRequest in project java-talent by googleapis.
the class JobSearchListTenants method listTenants.
// List Tenants.
public static void listTenants(String projectId) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (TenantServiceClient tenantServiceClient = TenantServiceClient.create()) {
ProjectName parent = ProjectName.of(projectId);
ListTenantsRequest request = ListTenantsRequest.newBuilder().setParent(parent.toString()).build();
for (Tenant responseItem : tenantServiceClient.listTenants(request).iterateAll()) {
System.out.format("Tenant Name: %s%n", responseItem.getName());
System.out.format("External ID: %s%n", responseItem.getExternalId());
}
}
}
Aggregations