Search in sources :

Example 1 with CompanyName

use of com.google.cloud.talent.v4beta1.CompanyName in project java-docs-samples by GoogleCloudPlatform.

the class JobSearchDeleteCompany method deleteCompany.

// Delete Company.
public static void deleteCompany(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);
        DeleteCompanyRequest request = DeleteCompanyRequest.newBuilder().setName(name.toString()).build();
        companyServiceClient.deleteCompany(request);
        System.out.println("Deleted company");
    }
}
Also used : DeleteCompanyRequest(com.google.cloud.talent.v4beta1.DeleteCompanyRequest) CompanyName(com.google.cloud.talent.v4beta1.CompanyName) CompanyServiceClient(com.google.cloud.talent.v4beta1.CompanyServiceClient)

Example 2 with CompanyName

use of com.google.cloud.talent.v4beta1.CompanyName 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)

Aggregations

CompanyName (com.google.cloud.talent.v4beta1.CompanyName)2 CompanyServiceClient (com.google.cloud.talent.v4beta1.CompanyServiceClient)2 Company (com.google.cloud.talent.v4beta1.Company)1 DeleteCompanyRequest (com.google.cloud.talent.v4beta1.DeleteCompanyRequest)1 GetCompanyRequest (com.google.cloud.talent.v4beta1.GetCompanyRequest)1