Search in sources :

Example 1 with DeleteKnowledgeBaseRequest

use of com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest in project java-dialogflow by googleapis.

the class CreateDocumentTest method tearDown.

@After
public void tearDown() throws IOException {
    // Delete the created knowledge base
    try (KnowledgeBasesClient client = KnowledgeBasesClient.create()) {
        DeleteKnowledgeBaseRequest request = DeleteKnowledgeBaseRequest.newBuilder().setName(knowledgeBaseName).setForce(true).build();
        client.deleteKnowledgeBase(request);
    }
    System.setOut(null);
}
Also used : DeleteKnowledgeBaseRequest(com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest) KnowledgeBasesClient(com.google.cloud.dialogflow.v2beta1.KnowledgeBasesClient) After(org.junit.After)

Example 2 with DeleteKnowledgeBaseRequest

use of com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest in project java-dialogflow by googleapis.

the class CreateKnowledgeBaseTest method tearDown.

@After
public void tearDown() throws IOException {
    if (knowledgeBaseName == null) {
        return;
    }
    // Delete the created knowledge base
    try (KnowledgeBasesClient client = KnowledgeBasesClient.create()) {
        DeleteKnowledgeBaseRequest request = DeleteKnowledgeBaseRequest.newBuilder().setName(knowledgeBaseName).setForce(true).build();
        client.deleteKnowledgeBase(request);
    }
    System.setOut(originalOutputStream);
}
Also used : DeleteKnowledgeBaseRequest(com.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest) KnowledgeBasesClient(com.google.cloud.dialogflow.v2.KnowledgeBasesClient) After(org.junit.After)

Aggregations

After (org.junit.After)2 DeleteKnowledgeBaseRequest (com.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest)1 KnowledgeBasesClient (com.google.cloud.dialogflow.v2.KnowledgeBasesClient)1 DeleteKnowledgeBaseRequest (com.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest)1 KnowledgeBasesClient (com.google.cloud.dialogflow.v2beta1.KnowledgeBasesClient)1