forked from SciSharp/BotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntentsController.cs
More file actions
53 lines (49 loc) · 1.51 KB
/
IntentsController.cs
File metadata and controls
53 lines (49 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using BotSharp.Platform.Dialogflow.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace BotSharp.Platform.Dialogflow.Controllers
{
/// <summary>
/// The /intents endpoint is used to create, retrieve, update, and delete intent objects.
/// </summary>
[Authorize]
[Route("v1/[controller]")]
public class IntentsController : ControllerBase
{
/// <summary>
/// Retrieves a list of all intents for the agent.
/// </summary>
/// <returns></returns>
[HttpGet]
public IEnumerable<DialogflowIntent> GetIntents()
{
return new List<DialogflowIntent>();
}
/// <summary>
/// The POST request creates a new intent. When a new intent is created via the API, the agent is trained with the new data.
/// </summary>
/// <returns></returns>
[HttpPost]
public string PostIntent([FromBody] DialogflowIntent intent)
{
return "";
}
/// <summary>
/// Retrieves the specified intent. {id} is the ID of the intent to retrieve.
/// </summary>
/// <returns></returns>
[HttpGet("{id}")]
public DialogflowIntent GetIntent()
{
return new DialogflowIntent();
}
[HttpPut("{id}")]
public bool PutIntent([FromBody] DialogflowIntent intent)
{
return true;
}
}
}