(projectId)
| 16 | 'use strict'; |
| 17 | |
| 18 | function main(projectId) { |
| 19 | // [START contactcenterinsights_create_issue_model] |
| 20 | /** |
| 21 | * TODO(developer): Uncomment this variable before running the sample. |
| 22 | */ |
| 23 | // const projectId = 'my_project_id'; |
| 24 | |
| 25 | // Imports the Contact Center Insights client. |
| 26 | const { |
| 27 | ContactCenterInsightsClient, |
| 28 | } = require('@google-cloud/contact-center-insights'); |
| 29 | |
| 30 | // Instantiates a client. |
| 31 | const client = new ContactCenterInsightsClient(); |
| 32 | |
| 33 | async function createIssueModel() { |
| 34 | const [operation] = await client.createIssueModel({ |
| 35 | parent: client.locationPath(projectId, 'us-central1'), |
| 36 | issueModel: { |
| 37 | displayName: 'my-model', |
| 38 | inputDataConfig: { |
| 39 | filter: 'medium="CHAT"', |
| 40 | }, |
| 41 | }, |
| 42 | }); |
| 43 | |
| 44 | // Wait for the operation to complete. |
| 45 | const [issueModel] = await operation.promise(); |
| 46 | console.info(`Created ${issueModel.name}`); |
| 47 | } |
| 48 | createIssueModel(); |
| 49 | // [END contactcenterinsights_create_issue_model] |
| 50 | } |
| 51 | |
| 52 | process.on('unhandledRejection', err => { |
| 53 | console.error(err.message); |
no test coverage detected