Search in sources :

Example 1 with GetCompanyRequest

use of com.google.cloud.talent.v4.GetCompanyRequest in project java-docs-samples by GoogleCloudPlatform.

the class JobSearchGetCompany method getCompany.

// Get Company.
public static void getCompany(String projectId, String tenantId, String companyId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
        CompanyName name = CompanyName.ofProjectTenantCompanyName(projectId, tenantId, companyId);
        GetCompanyRequest request = GetCompanyRequest.newBuilder().setName(name.toString()).build();
        Company response = companyServiceClient.getCompany(request);
        System.out.format("Company name: %s%n", response.getName());
        System.out.format("Display name: %s%n", response.getDisplayName());
    }
}
Also used : CompanyName(com.google.cloud.talent.v4beta1.CompanyName) CompanyServiceClient(com.google.cloud.talent.v4beta1.CompanyServiceClient) Company(com.google.cloud.talent.v4beta1.Company) GetCompanyRequest(com.google.cloud.talent.v4beta1.GetCompanyRequest)

Example 2 with GetCompanyRequest

use of com.google.cloud.talent.v4.GetCompanyRequest in project java-talent by googleapis.

the class JobSearchGetCompany method sampleGetCompany.

/**
 * Get Company
 */
public static void sampleGetCompany(String projectId, String tenantId, String companyId) {
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
        CompanyName name = CompanyWithTenantName.of(projectId, tenantId, companyId);
        GetCompanyRequest request = GetCompanyRequest.newBuilder().setName(name.toString()).build();
        Company response = companyServiceClient.getCompany(request);
        System.out.printf("Company name: %s\n", response.getName());
        System.out.printf("Display name: %s\n", response.getDisplayName());
    } catch (Exception exception) {
        System.err.println("Failed to create the client due to: " + exception);
    }
}
Also used : CompanyName(com.google.cloud.talent.v4beta1.CompanyName) CompanyServiceClient(com.google.cloud.talent.v4beta1.CompanyServiceClient) Company(com.google.cloud.talent.v4beta1.Company) GetCompanyRequest(com.google.cloud.talent.v4beta1.GetCompanyRequest)

Example 3 with GetCompanyRequest

use of com.google.cloud.talent.v4.GetCompanyRequest in project java-talent by googleapis.

the class ITSystemTest method getCompanyTest.

@Test
public void getCompanyTest() {
    GetCompanyRequest request = GetCompanyRequest.newBuilder().setName(companyName.toString()).build();
    Company actual = companyServiceClient.getCompany(request);
    assertEquals(company.getName(), actual.getName());
    assertEquals(company.getDisplayName(), actual.getDisplayName());
    assertEquals(company.getExternalId(), actual.getExternalId());
}
Also used : Company(com.google.cloud.talent.v4beta1.Company) GetCompanyRequest(com.google.cloud.talent.v4beta1.GetCompanyRequest) Test(org.junit.Test)

Example 4 with GetCompanyRequest

use of com.google.cloud.talent.v4.GetCompanyRequest in project java-talent by googleapis.

the class JobSearchGetCompany method getCompany.

// Get Company.
public static void getCompany(String projectId, String tenantId, String companyId) throws IOException {
    // the "close" method on the client to safely clean up any remaining background resources.
    try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
        CompanyName name = CompanyName.of(projectId, tenantId, companyId);
        GetCompanyRequest request = GetCompanyRequest.newBuilder().setName(name.toString()).build();
        Company response = companyServiceClient.getCompany(request);
        System.out.format("Company name: %s%n", response.getName());
        System.out.format("Display name: %s%n", response.getDisplayName());
    }
}
Also used : CompanyName(com.google.cloud.talent.v4.CompanyName) CompanyServiceClient(com.google.cloud.talent.v4.CompanyServiceClient) Company(com.google.cloud.talent.v4.Company) GetCompanyRequest(com.google.cloud.talent.v4.GetCompanyRequest)

Aggregations

Company (com.google.cloud.talent.v4beta1.Company)3 GetCompanyRequest (com.google.cloud.talent.v4beta1.GetCompanyRequest)3 CompanyName (com.google.cloud.talent.v4beta1.CompanyName)2 CompanyServiceClient (com.google.cloud.talent.v4beta1.CompanyServiceClient)2 Company (com.google.cloud.talent.v4.Company)1 CompanyName (com.google.cloud.talent.v4.CompanyName)1 CompanyServiceClient (com.google.cloud.talent.v4.CompanyServiceClient)1 GetCompanyRequest (com.google.cloud.talent.v4.GetCompanyRequest)1 Test (org.junit.Test)1