Search in sources :

Example 1 with DeleteTenantRequest

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

the class JobSearchDeleteTenant method deleteTenant.

// Delete Tenant.
public static void deleteTenant(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);
        DeleteTenantRequest request = DeleteTenantRequest.newBuilder().setName(name.toString()).build();
        tenantServiceClient.deleteTenant(request);
        System.out.println("Deleted Tenant.");
    }
}
Also used : TenantServiceClient(com.google.cloud.talent.v4beta1.TenantServiceClient) TenantName(com.google.cloud.talent.v4beta1.TenantName) DeleteTenantRequest(com.google.cloud.talent.v4beta1.DeleteTenantRequest)

Aggregations

DeleteTenantRequest (com.google.cloud.talent.v4beta1.DeleteTenantRequest)1 TenantName (com.google.cloud.talent.v4beta1.TenantName)1 TenantServiceClient (com.google.cloud.talent.v4beta1.TenantServiceClient)1