Diese Seite wurde von der Cloud Translation API übersetzt.
Switch to English

Mandanten löschen (v4beta1)

Mandanten löschen.

Dokumentationsseiten mit diesem Codebeispiel

Das Codebeispiel im Kontext finden Sie in der folgenden Dokumentation:

Codebeispiel

C#

public static object DeleteTenant(string projectId, string tenantId)
{
    TenantServiceClient tenantServiceClient = TenantServiceClient.Create();
    TenantName tenantName = TenantName.FromProjectTenant(projectId, tenantId);
    DeleteTenantRequest request = new DeleteTenantRequest
    {
        TenantName = tenantName
    };
    tenantServiceClient.DeleteTenant(request);
    Console.WriteLine($"Deleted Tenant.");
    return 0;
}

Java


import com.google.cloud.talent.v4.DeleteTenantRequest;
import com.google.cloud.talent.v4.TenantName;
import com.google.cloud.talent.v4.TenantServiceClient;
import java.io.IOException;

public class JobSearchDeleteTenant {

  public static void deleteTenant() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    deleteTenant(projectId, tenantId);
  }

  // Delete Tenant.
  public static void deleteTenant(String projectId, String tenantId) throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // 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.");
    }
  }
}