use of com.google.cloud.talent.v4beta1.GetTenantRequest in project java-docs-samples by GoogleCloudPlatform.
the class JobSearchGetTenant method getTenant.
// Get Tenant by name.
public static void getTenant(String projectId, String tenantId) throws IOException {
// the "close" method on the client to safely clean up any remaining background resources.
try (TenantServiceClient tenantServiceClient = TenantServiceClient.create()) {
TenantName name = TenantName.of(projectId, tenantId);
GetTenantRequest request = GetTenantRequest.newBuilder().setName(name.toString()).build();
Tenant response = tenantServiceClient.getTenant(request);
System.out.format("Name: %s%n", response.getName());
System.out.format("External ID: %s%n", response.getExternalId());
}
}
Aggregations