use of com.google.cloud.talent.v4.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");
}
}
use of com.google.cloud.talent.v4.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());
}
}
use of com.google.cloud.talent.v4.CompanyName in project java-talent by googleapis.
the class JobSearchDeleteCompany method sampleDeleteCompany.
/**
* Delete Company
*/
public static void sampleDeleteCompany(String projectId, String tenantId, String companyId) {
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
CompanyName name = CompanyWithTenantName.of(projectId, tenantId, companyId);
DeleteCompanyRequest request = DeleteCompanyRequest.newBuilder().setName(name.toString()).build();
companyServiceClient.deleteCompany(request);
System.out.println("Deleted company");
} catch (Exception exception) {
System.err.println("Failed to create the client due to: " + exception);
}
}
use of com.google.cloud.talent.v4.CompanyName 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);
}
}
use of com.google.cloud.talent.v4.CompanyName in project java-talent by googleapis.
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.of(projectId, tenantId, companyId);
DeleteCompanyRequest request = DeleteCompanyRequest.newBuilder().setName(name.toString()).build();
companyServiceClient.deleteCompany(request);
System.out.println("Deleted company");
}
}
Aggregations