{"action":"opened","issue":{"url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/246","repository_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow","labels_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/246/comments","events_url":"https://api.github.com/repos/googleapis/nodejs-dialogflow/issues/246/events","html_url":"https://github.com/googleapis/nodejs-dialogflow/issues/246","id":389596871,"node_id":"MDU6SXNzdWUzODk1OTY4NzE=","number":246,"title":"Not able to update intent","user":{"login":"AsoOor","id":37495693,"node_id":"MDQ6VXNlcjM3NDk1Njkz","avatar_url":"https://avatars0.githubusercontent.com/u/37495693?v=4","gravatar_id":"","url":"https://api.github.com/users/AsoOor","html_url":"https://github.com/AsoOor","followers_url":"https://api.github.com/users/AsoOor/followers","following_url":"https://api.github.com/users/AsoOor/following{/other_user}","gists_url":"https://api.github.com/users/AsoOor/gists{/gist_id}","starred_url":"https://api.github.com/users/AsoOor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsoOor/subscriptions","organizations_url":"https://api.github.com/users/AsoOor/orgs","repos_url":"https://api.github.com/users/AsoOor/repos","events_url":"https://api.github.com/users/AsoOor/events{/privacy}","received_events_url":"https://api.github.com/users/AsoOor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-11T04:56:26Z","updated_at":"2018-12-11T04:56:26Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI am trying to update specific intent, but I cannot.\r\nHere is the code:\r\n\r\n\r\n     async function updateIntent () {\r\n\r\n     const dialogflow = require('dialogflow');\r\n\r\n     const projectId = 'project-id';\r\n\r\n     const intentId = 'intent-id';\r\n\r\n    const trainingPhrasesParts = ['test1', 'test2'];\r\n\r\n     const intentsClient = new dialogflow.IntentsClient();\r\n\r\n     const intentPath = intentsClient.intentPath(projectId, intentId);\r\n\r\n     const trainingPhrases = [];\r\n\r\n     trainingPhrasesParts.forEach(trainingPhrasesPart => {\r\n          const part = {\r\n               text: trainingPhrasesPart,\r\n           };\r\n\r\n          const trainingPhrase = {\r\n               type: 'EXAMPLE',\r\n               parts: [part],\r\n          };\r\n\r\n          trainingPhrases.push(trainingPhrase);\r\n    });\r\n\r\n\r\n    const intent = {\r\n        trainingPhrases: trainingPhrases\r\n    };\r\n\r\n    const updateIntentRequest = {\r\n        name: intentPath,\r\n        intent: intent\r\n    };\r\n\r\n    try {\r\n        const responses = await intentsClient.updateIntent(updateIntentRequest);\r\n        response.send(responses);\r\n    }\r\n    catch (error) {\r\n        response.send(error);\r\n    }\r\n    }"}}
{"actor":{"display_login":"AsoOor"}}