Search in sources :

Example 1 with GetTenantRequest

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());
    }
}
Also used : TenantServiceClient(com.google.cloud.talent.v4beta1.TenantServiceClient) Tenant(com.google.cloud.talent.v4beta1.Tenant) TenantName(com.google.cloud.talent.v4beta1.TenantName) GetTenantRequest(com.google.cloud.talent.v4beta1.GetTenantRequest)

Aggregations

GetTenantRequest (com.google.cloud.talent.v4beta1.GetTenantRequest)1 Tenant (com.google.cloud.talent.v4beta1.Tenant)1 TenantName (com.google.cloud.talent.v4beta1.TenantName)1 TenantServiceClient (com.google.cloud.talent.v4beta1.TenantServiceClient)1