| 19 | // ///////////////////////////////////////////////////////////////////////////// |
| 20 | |
| 21 | async function deleteIntent(projectId, intentId) { |
| 22 | // [START dialogflow_delete_intent] |
| 23 | // Imports the Dialogflow library |
| 24 | const dialogflow = require('@google-cloud/dialogflow'); |
| 25 | |
| 26 | // Instantiates clients |
| 27 | const intentsClient = new dialogflow.IntentsClient(); |
| 28 | |
| 29 | const intentPath = intentsClient.projectAgentIntentPath(projectId, intentId); |
| 30 | |
| 31 | const request = {name: intentPath}; |
| 32 | |
| 33 | // Send the request for deleting the intent. |
| 34 | const result = await intentsClient.deleteIntent(request); |
| 35 | console.log(`Intent ${intentPath} deleted`); |
| 36 | return result; |
| 37 | // [END dialogflow_delete_intent] |
| 38 | } |
| 39 | |
| 40 | // ///////////////////////////////////////////////////////////////////////////// |
| 41 | // Operations for session entity type |