Search in sources :

Example 21 with Tenant

use of com.google.cloud.talent.v4.Tenant 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());
        }
    }
}
Also used : TenantServiceClient(com.google.cloud.talent.v4.TenantServiceClient) Tenant(com.google.cloud.talent.v4.Tenant) ProjectName(com.google.cloud.talent.v4.ProjectName) ListTenantsRequest(com.google.cloud.talent.v4.ListTenantsRequest)

Aggregations

Tenant (com.google.cloud.talent.v4beta1.Tenant)10 Test (org.junit.Test)7 TenantServiceClient (com.google.cloud.talent.v4beta1.TenantServiceClient)6 TenantServiceClient (com.google.cloud.talent.v4.TenantServiceClient)4 ProjectName (com.google.cloud.talent.v4beta1.ProjectName)4 AbstractMessage (com.google.protobuf.AbstractMessage)4 Tenant (com.google.cloud.talent.v4.Tenant)3 TenantName (com.google.cloud.talent.v4.TenantName)3 CreateTenantRequest (com.google.cloud.talent.v4beta1.CreateTenantRequest)3 GetTenantRequest (com.google.cloud.talent.v4beta1.GetTenantRequest)3 ListTenantsRequest (com.google.cloud.talent.v4beta1.ListTenantsRequest)3 ProjectName (com.google.cloud.talent.v4.ProjectName)2 ListTenantsPagedResponse (com.google.cloud.talent.v4.TenantServiceClient.ListTenantsPagedResponse)2 TenantName (com.google.cloud.talent.v4beta1.TenantName)2 Tenant (org.openstack4j.model.identity.v2.Tenant)2 ClientEvent (com.google.cloud.talent.v4.ClientEvent)1 ListCompaniesPagedResponse (com.google.cloud.talent.v4.CompanyServiceClient.ListCompaniesPagedResponse)1 CreateClientEventRequest (com.google.cloud.talent.v4.CreateClientEventRequest)1 CreateTenantRequest (com.google.cloud.talent.v4.CreateTenantRequest)1 DeleteTenantRequest (com.google.cloud.talent.v4.DeleteTenantRequest)1