Search in sources :

Example 1 with AgentsClient

use of com.google.cloud.dialogflow.v2.AgentsClient in project java-dialogflow-cx by googleapis.

the class CreateAgentIT method tearDown.

@After
public void tearDown() throws IOException {
    System.setOut(originalOut);
    String apiEndpoint = "global-dialogflow.googleapis.com:443";
    AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build();
    AgentsClient client = AgentsClient.create(agentsSettings);
    client.deleteAgent(CreateAgentIT.agentPath);
}
Also used : AgentsSettings(com.google.cloud.dialogflow.cx.v3.AgentsSettings) AgentsClient(com.google.cloud.dialogflow.cx.v3.AgentsClient) After(org.junit.After)

Example 2 with AgentsClient

use of com.google.cloud.dialogflow.v2.AgentsClient in project java-dialogflow-cx by googleapis.

the class ExportAgentIT method setUp.

@Before
public void setUp() throws IOException {
    stdOut = new ByteArrayOutputStream();
    System.setOut(new PrintStream(stdOut));
    Builder build = Agent.newBuilder();
    build.setDefaultLanguageCode("en");
    build.setDisplayName("temp_agent_" + UUID.randomUUID().toString());
    build.setTimeZone("America/Los_Angeles");
    Agent agent = build.build();
    String apiEndpoint = "global-dialogflow.googleapis.com:443";
    String parentPath = "projects/" + PROJECT_ID + "/locations/global";
    AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build();
    AgentsClient client = AgentsClient.create(agentsSettings);
    parent = client.createAgent(parentPath, agent).getName();
    ExportAgentIT.agentPath = parent;
    ExportAgentIT.agentID = parent.split("/")[5];
    client.close();
}
Also used : PrintStream(java.io.PrintStream) Agent(com.google.cloud.dialogflow.cx.v3.Agent) AgentsSettings(com.google.cloud.dialogflow.cx.v3.AgentsSettings) AgentsClient(com.google.cloud.dialogflow.cx.v3.AgentsClient) Builder(com.google.cloud.dialogflow.cx.v3.Agent.Builder) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Before(org.junit.Before)

Example 3 with AgentsClient

use of com.google.cloud.dialogflow.v2.AgentsClient in project java-dialogflow-cx by googleapis.

the class ExportAgentIT method tearDown.

@After
public void tearDown() throws IOException {
    stdOut = null;
    System.setOut(null);
    String apiEndpoint = "global-dialogflow.googleapis.com:443";
    AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build();
    AgentsClient client = AgentsClient.create(agentsSettings);
    client.deleteAgent(ExportAgentIT.agentPath);
    client.close();
}
Also used : AgentsSettings(com.google.cloud.dialogflow.cx.v3.AgentsSettings) AgentsClient(com.google.cloud.dialogflow.cx.v3.AgentsClient) After(org.junit.After)

Example 4 with AgentsClient

use of com.google.cloud.dialogflow.v2.AgentsClient in project java-dialogflow-cx by googleapis.

the class PageManagementIT method setUp.

@BeforeClass
public static void setUp() throws IOException {
    stdOut = new ByteArrayOutputStream();
    System.setOut(new PrintStream(stdOut));
    Builder build = Agent.newBuilder();
    build.setDefaultLanguageCode("en");
    build.setDisplayName("temp_agent_" + UUID.randomUUID().toString());
    build.setTimeZone("America/Los_Angeles");
    Agent agent = build.build();
    String apiEndpoint = "global-dialogflow.googleapis.com:443";
    String parentPath = "projects/" + PROJECT_ID + "/locations/global";
    AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build();
    AgentsClient client = AgentsClient.create(agentsSettings);
    parent = client.createAgent(parentPath, agent).getName();
    agentID = parent.split("/")[5];
}
Also used : PrintStream(java.io.PrintStream) Agent(com.google.cloud.dialogflow.cx.v3.Agent) AgentsSettings(com.google.cloud.dialogflow.cx.v3.AgentsSettings) AgentsClient(com.google.cloud.dialogflow.cx.v3.AgentsClient) Builder(com.google.cloud.dialogflow.cx.v3.Agent.Builder) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BeforeClass(org.junit.BeforeClass)

Example 5 with AgentsClient

use of com.google.cloud.dialogflow.v2.AgentsClient in project java-dialogflow-cx by googleapis.

the class PageManagementIT method tearDown.

@AfterClass
public static void tearDown() throws IOException {
    String apiEndpoint = "global-dialogflow.googleapis.com:443";
    String parentPath = "projects/" + PROJECT_ID + "/locations/global";
    AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build();
    AgentsClient client = AgentsClient.create(agentsSettings);
    client.deleteAgent(parent);
}
Also used : AgentsSettings(com.google.cloud.dialogflow.cx.v3.AgentsSettings) AgentsClient(com.google.cloud.dialogflow.cx.v3.AgentsClient) AfterClass(org.junit.AfterClass)

Aggregations

AgentsClient (com.google.cloud.dialogflow.cx.v3.AgentsClient)9 AgentsSettings (com.google.cloud.dialogflow.cx.v3.AgentsSettings)9 Agent (com.google.cloud.dialogflow.cx.v3.Agent)4 Builder (com.google.cloud.dialogflow.cx.v3.Agent.Builder)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 PrintStream (java.io.PrintStream)3 After (org.junit.After)3 Before (org.junit.Before)2 BeforeClass (org.junit.BeforeClass)2 ExportAgentRequest (com.google.cloud.dialogflow.cx.v3.ExportAgentRequest)1 ExportAgentResponse (com.google.cloud.dialogflow.cx.v3.ExportAgentResponse)1 Intent (com.google.cloud.dialogflow.cx.v3.Intent)1 IntentsClient (com.google.cloud.dialogflow.cx.v3.IntentsClient)1 Agent (com.google.cloud.dialogflow.v2.Agent)1 Builder (com.google.cloud.dialogflow.v2.Agent.Builder)1 AgentsClient (com.google.cloud.dialogflow.v2.AgentsClient)1 AgentsSettings (com.google.cloud.dialogflow.v2.AgentsSettings)1 Context (com.google.cloud.dialogflow.v2.Context)1 CreateContextRequest (com.google.cloud.dialogflow.v2.CreateContextRequest)1 CreateEntityTypeRequest (com.google.cloud.dialogflow.v2.CreateEntityTypeRequest)1