From 185875a571765e6e5810e7ba09f12d6daca34764 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 13 Dec 2022 22:24:42 +0000 Subject: [PATCH 1/2] feat: add Configurable Analysis, Bulk Upload, Bulk Analyze, Delete Issue Apis PiperOrigin-RevId: 495057883 Source-Link: https://github.com/googleapis/googleapis/commit/59a66eb3180ea8474c0a22da3fe964dbe7428c77 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9e7f289c6c6e4fd5f63b6dcfee0d272ab1dca1de Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRhY3RjZW50ZXJpbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiOWU3ZjI4OWM2YzZlNGZkNWY2M2I2ZGNmZWUwZDI3MmFiMWRjYTFkZSJ9 --- .../v1/.eslintignore | 7 + .../v1/.eslintrc.json | 3 + .../v1/.gitignore | 14 + .../v1/.jsdoc.js | 55 + .../v1/.mocharc.js | 33 + .../v1/.prettierrc.js | 22 + .../v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../v1/package.json | 64 + .../v1/contact_center_insights.proto | 1263 ++++ .../contactcenterinsights/v1/resources.proto | 1180 ++++ ...ter_insights.bulk_analyze_conversations.js | 78 + ...er_insights.calculate_issue_model_stats.js | 61 + ...contact_center_insights.calculate_stats.js | 66 + ...contact_center_insights.create_analysis.js | 67 + ...act_center_insights.create_conversation.js | 74 + ...tact_center_insights.create_issue_model.js | 67 + ...t_center_insights.create_phrase_matcher.js | 69 + .../v1/contact_center_insights.create_view.js | 69 + ...contact_center_insights.delete_analysis.js | 61 + ...act_center_insights.delete_conversation.js | 67 + .../contact_center_insights.delete_issue.js | 61 + ...tact_center_insights.delete_issue_model.js | 62 + ...t_center_insights.delete_phrase_matcher.js | 61 + .../v1/contact_center_insights.delete_view.js | 61 + ...tact_center_insights.deploy_issue_model.js | 62 + ...ct_center_insights.export_insights_data.js | 81 + .../contact_center_insights.get_analysis.js | 61 + ...ontact_center_insights.get_conversation.js | 65 + .../v1/contact_center_insights.get_issue.js | 61 + ...contact_center_insights.get_issue_model.js | 61 + ...tact_center_insights.get_phrase_matcher.js | 61 + .../contact_center_insights.get_settings.js | 61 + .../v1/contact_center_insights.get_view.js | 61 + ...ct_center_insights.ingest_conversations.js | 74 + .../contact_center_insights.list_analyses.js | 81 + ...tact_center_insights.list_conversations.js | 85 + ...ntact_center_insights.list_issue_models.js | 61 + .../v1/contact_center_insights.list_issues.js | 61 + ...ct_center_insights.list_phrase_matchers.js | 81 + .../v1/contact_center_insights.list_views.js | 76 + ...ct_center_insights.undeploy_issue_model.js | 62 + ...act_center_insights.update_conversation.js | 65 + .../contact_center_insights.update_issue.js | 65 + ...tact_center_insights.update_issue_model.js | 65 + ...t_center_insights.update_phrase_matcher.js | 65 + ...contact_center_insights.update_settings.js | 66 + .../v1/contact_center_insights.update_view.js | 65 + ...google.cloud.contactcenterinsights.v1.json | 1643 +++++ .../v1/src/index.ts | 25 + .../src/v1/contact_center_insights_client.ts | 4370 +++++++++++++ ...contact_center_insights_client_config.json | 223 + .../contact_center_insights_proto_list.json | 4 + .../v1/src/v1/gapic_metadata.json | 409 ++ .../v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../test/gapic_contact_center_insights_v1.ts | 5775 +++++++++++++++++ .../v1/tsconfig.json | 19 + .../v1/webpack.config.js | 64 + 61 files changed, 17787 insertions(+) create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.ingest_conversations.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js new file mode 100644 index 00000000000..176aa3b31d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/contact-center-insights', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js new file mode 100644 index 00000000000..481c522b00f --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js new file mode 100644 index 00000000000..494e147865d --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md b/owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md new file mode 100644 index 00000000000..eabc434ea0d --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md @@ -0,0 +1 @@ +Contactcenterinsights: Nodejs Client diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json new file mode 100644 index 00000000000..87ba02bdf50 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/contact-center-insights", + "version": "0.1.0", + "description": "Contactcenterinsights client for Node.js", + "repository": "googleapis/nodejs-contactcenterinsights", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google contactcenterinsights", + "contactcenterinsights", + "contact center insights" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.62", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.0.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.8.3", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto b/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto new file mode 100644 index 00000000000..1ecf4321683 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto @@ -0,0 +1,1263 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.contactcenterinsights.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/contactcenterinsights/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.ContactCenterInsights.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/contactcenterinsights/v1;contactcenterinsights"; +option java_multiple_files = true; +option java_outer_classname = "ContactCenterInsightsProto"; +option java_package = "com.google.cloud.contactcenterinsights.v1"; +option php_namespace = "Google\\Cloud\\ContactCenterInsights\\V1"; +option ruby_package = "Google::Cloud::ContactCenterInsights::V1"; + +// An API that lets users analyze and explore their business conversation data. +service ContactCenterInsights { + option (google.api.default_host) = "contactcenterinsights.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a conversation. + rpc CreateConversation(CreateConversationRequest) returns (Conversation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversations" + body: "conversation" + }; + option (google.api.method_signature) = "parent,conversation,conversation_id"; + } + + // Updates a conversation. + rpc UpdateConversation(UpdateConversationRequest) returns (Conversation) { + option (google.api.http) = { + patch: "/v1/{conversation.name=projects/*/locations/*/conversations/*}" + body: "conversation" + }; + option (google.api.method_signature) = "conversation,update_mask"; + } + + // Gets a conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists conversations. + rpc ListConversations(ListConversationsRequest) returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/conversations" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a conversation. + rpc DeleteConversation(DeleteConversationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/conversations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an analysis. The long running operation is done when the analysis + // has completed. + rpc CreateAnalysis(CreateAnalysisRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/conversations/*}/analyses" + body: "analysis" + }; + option (google.api.method_signature) = "parent,analysis"; + option (google.longrunning.operation_info) = { + response_type: "Analysis" + metadata_type: "CreateAnalysisOperationMetadata" + }; + } + + // Gets an analysis. + rpc GetAnalysis(GetAnalysisRequest) returns (Analysis) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/conversations/*/analyses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists analyses. + rpc ListAnalyses(ListAnalysesRequest) returns (ListAnalysesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/conversations/*}/analyses" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes an analysis. + rpc DeleteAnalysis(DeleteAnalysisRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/conversations/*/analyses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Analyzes multiple conversations in a single request. + rpc BulkAnalyzeConversations(BulkAnalyzeConversationsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversations:bulkAnalyze" + body: "*" + }; + option (google.api.method_signature) = "parent,filter,analysis_percentage"; + option (google.longrunning.operation_info) = { + response_type: "BulkAnalyzeConversationsResponse" + metadata_type: "BulkAnalyzeConversationsMetadata" + }; + } + + // Imports conversations and processes them according to the user's + // configuration. + rpc IngestConversations(IngestConversationsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversations:ingest" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "IngestConversationsResponse" + metadata_type: "IngestConversationsMetadata" + }; + } + + // Export insights data to a destination defined in the request body. + rpc ExportInsightsData(ExportInsightsDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/insightsdata:export" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "ExportInsightsDataResponse" + metadata_type: "ExportInsightsDataMetadata" + }; + } + + // Creates an issue model. + rpc CreateIssueModel(CreateIssueModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/issueModels" + body: "issue_model" + }; + option (google.api.method_signature) = "parent,issue_model"; + option (google.longrunning.operation_info) = { + response_type: "IssueModel" + metadata_type: "CreateIssueModelMetadata" + }; + } + + // Updates an issue model. + rpc UpdateIssueModel(UpdateIssueModelRequest) returns (IssueModel) { + option (google.api.http) = { + patch: "/v1/{issue_model.name=projects/*/locations/*/issueModels/*}" + body: "issue_model" + }; + option (google.api.method_signature) = "issue_model,update_mask"; + } + + // Gets an issue model. + rpc GetIssueModel(GetIssueModelRequest) returns (IssueModel) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/issueModels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists issue models. + rpc ListIssueModels(ListIssueModelsRequest) returns (ListIssueModelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/issueModels" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes an issue model. + rpc DeleteIssueModel(DeleteIssueModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/issueModels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteIssueModelMetadata" + }; + } + + // Deploys an issue model. Returns an error if a model is already deployed. + // An issue model can only be used in analysis after it has been deployed. + rpc DeployIssueModel(DeployIssueModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/issueModels/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "DeployIssueModelResponse" + metadata_type: "DeployIssueModelMetadata" + }; + } + + // Undeploys an issue model. + // An issue model can not be used in analysis after it has been undeployed. + rpc UndeployIssueModel(UndeployIssueModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/issueModels/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "UndeployIssueModelResponse" + metadata_type: "UndeployIssueModelMetadata" + }; + } + + // Gets an issue. + rpc GetIssue(GetIssueRequest) returns (Issue) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists issues. + rpc ListIssues(ListIssuesRequest) returns (ListIssuesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/issueModels/*}/issues" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an issue. + rpc UpdateIssue(UpdateIssueRequest) returns (Issue) { + option (google.api.http) = { + patch: "/v1/{issue.name=projects/*/locations/*/issueModels/*/issues/*}" + body: "issue" + }; + option (google.api.method_signature) = "issue,update_mask"; + } + + // Deletes an issue. + rpc DeleteIssue(DeleteIssueRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets an issue model's statistics. + rpc CalculateIssueModelStats(CalculateIssueModelStatsRequest) returns (CalculateIssueModelStatsResponse) { + option (google.api.http) = { + get: "/v1/{issue_model=projects/*/locations/*/issueModels/*}:calculateIssueModelStats" + }; + option (google.api.method_signature) = "issue_model"; + } + + // Creates a phrase matcher. + rpc CreatePhraseMatcher(CreatePhraseMatcherRequest) returns (PhraseMatcher) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/phraseMatchers" + body: "phrase_matcher" + }; + option (google.api.method_signature) = "parent,phrase_matcher"; + } + + // Gets a phrase matcher. + rpc GetPhraseMatcher(GetPhraseMatcherRequest) returns (PhraseMatcher) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/phraseMatchers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists phrase matchers. + rpc ListPhraseMatchers(ListPhraseMatchersRequest) returns (ListPhraseMatchersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/phraseMatchers" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a phrase matcher. + rpc DeletePhraseMatcher(DeletePhraseMatcherRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/phraseMatchers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a phrase matcher. + rpc UpdatePhraseMatcher(UpdatePhraseMatcherRequest) returns (PhraseMatcher) { + option (google.api.http) = { + patch: "/v1/{phrase_matcher.name=projects/*/locations/*/phraseMatchers/*}" + body: "phrase_matcher" + }; + option (google.api.method_signature) = "phrase_matcher,update_mask"; + } + + // Gets conversation statistics. + rpc CalculateStats(CalculateStatsRequest) returns (CalculateStatsResponse) { + option (google.api.http) = { + get: "/v1/{location=projects/*/locations/*}/conversations:calculateStats" + }; + option (google.api.method_signature) = "location"; + } + + // Gets project-level settings. + rpc GetSettings(GetSettingsRequest) returns (Settings) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/settings}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates project-level settings. + rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) { + option (google.api.http) = { + patch: "/v1/{settings.name=projects/*/locations/*/settings}" + body: "settings" + }; + option (google.api.method_signature) = "settings,update_mask"; + } + + // Creates a view. + rpc CreateView(CreateViewRequest) returns (View) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/views" + body: "view" + }; + option (google.api.method_signature) = "parent,view"; + } + + // Gets a view. + rpc GetView(GetViewRequest) returns (View) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/views/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists views. + rpc ListViews(ListViewsRequest) returns (ListViewsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/views" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a view. + rpc UpdateView(UpdateViewRequest) returns (View) { + option (google.api.http) = { + patch: "/v1/{view.name=projects/*/locations/*/views/*}" + body: "view" + }; + option (google.api.method_signature) = "view,update_mask"; + } + + // Deletes a view. + rpc DeleteView(DeleteViewRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/views/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents the options for viewing a conversation. +enum ConversationView { + // The conversation view is not specified. + // + // * Defaults to `FULL` in `GetConversationRequest`. + // * Defaults to `BASIC` in `ListConversationsRequest`. + CONVERSATION_VIEW_UNSPECIFIED = 0; + + // Populates all fields in the conversation. + FULL = 2; + + // Populates all fields in the conversation except the transcript. + BASIC = 1; +} + +// The request for calculating conversation statistics. +message CalculateStatsRequest { + // Required. The location of the conversations. + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // A filter to reduce results to a specific subset. This field is useful for + // getting statistics about conversations with specific properties. + string filter = 2; +} + +// The response for calculating conversation statistics. +message CalculateStatsResponse { + // A time series representing conversations over time. + message TimeSeries { + // A single interval in a time series. + message Interval { + // The start time of this interval. + google.protobuf.Timestamp start_time = 1; + + // The number of conversations created in this interval. + int32 conversation_count = 2; + } + + // The duration of each interval. + google.protobuf.Duration interval_duration = 1; + + // An ordered list of intervals from earliest to latest, where each interval + // represents the number of conversations that transpired during the time + // window. + repeated Interval points = 2; + } + + // The average duration of all conversations. The average is calculated using + // only conversations that have a time duration. + google.protobuf.Duration average_duration = 1; + + // The average number of turns per conversation. + int32 average_turn_count = 2; + + // The total number of conversations. + int32 conversation_count = 3; + + // A map associating each smart highlighter display name with its respective + // number of matches in the set of conversations. + map smart_highlighter_matches = 4; + + // A map associating each custom highlighter resource name with its respective + // number of matches in the set of conversations. + map custom_highlighter_matches = 5; + + // A map associating each issue resource name with its respective number of + // matches in the set of conversations. Key has the format: + // `projects//locations//issueModels//issues/` + // Deprecated, use `issue_matches_stats` field instead. + map issue_matches = 6 [deprecated = true]; + + // A map associating each issue resource name with its respective number of + // matches in the set of conversations. Key has the format: + // `projects//locations//issueModels//issues/` + map issue_matches_stats = 8; + + // A time series representing the count of conversations created over time + // that match that requested filter criteria. + TimeSeries conversation_count_time_series = 7; +} + +// Metadata for a create analysis operation. +message CreateAnalysisOperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Conversation that this Analysis Operation belongs to. + string conversation = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Conversation" + } + ]; + + // Output only. The annotator selector used for the analysis (if any). + AnnotatorSelector annotator_selector = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request to create a conversation. +message CreateConversationRequest { + // Required. The parent resource of the conversation. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The conversation resource to create. + Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED]; + + // A unique ID for the new conversation. This ID will become the final + // component of the conversation's resource name. If no ID is specified, a + // server-generated ID will be used. + // + // This value should be 4-64 characters and must match the regular + // expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-` + string conversation_id = 3; +} + +// Request to list conversations. +message ListConversationsRequest { + // Required. The parent resource of the conversation. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of conversations to return in the response. A valid page + // size ranges from 0 to 1,000 inclusive. If the page size is zero or + // unspecified, a default page size of 100 will be chosen. Note that a call + // might return fewer results than the requested page size. + int32 page_size = 2; + + // The value returned by the last `ListConversationsResponse`. This value + // indicates that this is a continuation of a prior `ListConversations` call + // and that the system should return the next page of data. + string page_token = 3; + + // A filter to reduce results to a specific subset. Useful for querying + // conversations with specific properties. + string filter = 4; + + // The level of details of the conversation. Default is `BASIC`. + ConversationView view = 5; +} + +// The response of listing conversations. +message ListConversationsResponse { + // The conversations that match the request. + repeated Conversation conversations = 1; + + // A token which can be sent as `page_token` to retrieve the next page. If + // this field is set, it means there is another page available. If it is not + // set, it means no other pages are available. + string next_page_token = 2; +} + +// The request to get a conversation. +message GetConversationRequest { + // Required. The name of the conversation to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Conversation" + } + ]; + + // The level of details of the conversation. Default is `FULL`. + ConversationView view = 2; +} + +// The request to update a conversation. +message UpdateConversationRequest { + // Required. The new values for the conversation. + Conversation conversation = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request to delete a conversation. +message DeleteConversationRequest { + // Required. The name of the conversation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Conversation" + } + ]; + + // If set to true, all of this conversation's analyses will also be deleted. + // Otherwise, the request will only succeed if the conversation has no + // analyses. + bool force = 2; +} + +// The request to ingest conversations. +message IngestConversationsRequest { + // Configuration for Cloud Storage bucket sources. + message GcsSource { + // Required. The Cloud Storage bucket containing source objects. + string bucket_uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for processing transcript objects. + message TranscriptObjectConfig { + // Required. The medium transcript objects represent. + Conversation.Medium medium = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration that applies to all conversations. + message ConversationConfig { + // An opaque, user-specified string representing the human agent who handled + // the conversations. + string agent_id = 1; + } + + // Configuration for an external data store containing objects that will + // be converted to conversations. + oneof source { + // A cloud storage bucket source. + GcsSource gcs_source = 2; + } + + // Configuration for converting individual `source` objects to conversations. + oneof object_config { + // Configuration for when `source` contains conversation transcripts. + TranscriptObjectConfig transcript_object_config = 3; + } + + // Required. The parent resource for new conversations. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Configuration that applies to all conversations. + ConversationConfig conversation_config = 4; +} + +// The metadata for an IngestConversations operation. +message IngestConversationsMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The original request for ingest. + IngestConversationsRequest request = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Partial errors during ingest operation that might cause the operation + // output to be incomplete. + repeated google.rpc.Status partial_errors = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The response to an IngestConversations operation. +message IngestConversationsResponse { + +} + +// The request to create an analysis. +message CreateAnalysisRequest { + // Required. The parent resource of the analysis. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Conversation" + } + ]; + + // Required. The analysis to create. + Analysis analysis = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request to list analyses. +message ListAnalysesRequest { + // Required. The parent resource of the analyses. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Conversation" + } + ]; + + // The maximum number of analyses to return in the response. If this + // value is zero, the service will select a default size. A call might return + // fewer objects than requested. A non-empty `next_page_token` in the response + // indicates that more data is available. + int32 page_size = 2; + + // The value returned by the last `ListAnalysesResponse`; indicates + // that this is a continuation of a prior `ListAnalyses` call and + // the system should return the next page of data. + string page_token = 3; + + // A filter to reduce results to a specific subset. Useful for querying + // conversations with specific properties. + string filter = 4; +} + +// The response to list analyses. +message ListAnalysesResponse { + // The analyses that match the request. + repeated Analysis analyses = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request to get an analysis. +message GetAnalysisRequest { + // Required. The name of the analysis to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Analysis" + } + ]; +} + +// The request to delete an analysis. +message DeleteAnalysisRequest { + // Required. The name of the analysis to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Analysis" + } + ]; +} + +// The request to analyze conversations in bulk. +message BulkAnalyzeConversationsRequest { + // Required. The parent resource to create analyses in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Filter used to select the subset of conversations to analyze. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Percentage of selected conversation to analyze, between + // [0, 100]. + float analysis_percentage = 3 [(google.api.field_behavior) = REQUIRED]; + + // To select the annotators to run and the phrase matchers to use + // (if any). If not specified, all annotators will be run. + AnnotatorSelector annotator_selector = 8; +} + +// The metadata for a bulk analyze conversations operation. +message BulkAnalyzeConversationsMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // The original request for bulk analyze. + BulkAnalyzeConversationsRequest request = 3; + + // The number of requested analyses that have completed successfully so far. + int32 completed_analyses_count = 4; + + // The number of requested analyses that have failed so far. + int32 failed_analyses_count = 5; + + // Total number of analyses requested. Computed by the number of conversations + // returned by `filter` multiplied by `analysis_percentage` in the request. + int32 total_requested_analyses_count = 6; +} + +// The response for a bulk analyze conversations operation. +message BulkAnalyzeConversationsResponse { + // Count of successful analyses. + int32 successful_analysis_count = 1; + + // Count of failed analyses. + int32 failed_analysis_count = 2; +} + +// The request to export insights. +message ExportInsightsDataRequest { + // A BigQuery Table Reference. + message BigQueryDestination { + // A project ID or number. If specified, then export will attempt to + // write data to this project instead of the resource project. Otherwise, + // the resource project will be used. + string project_id = 3; + + // Required. The name of the BigQuery dataset that the snapshot result should be + // exported to. If this dataset does not exist, the export call returns an + // INVALID_ARGUMENT error. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The BigQuery table name to which the insights data should be written. + // If this table does not exist, the export call returns an INVALID_ARGUMENT + // error. + string table = 2; + } + + // Specifies the action that occurs if the destination table already exists. + enum WriteDisposition { + // Write disposition is not specified. Defaults to WRITE_TRUNCATE. + WRITE_DISPOSITION_UNSPECIFIED = 0; + + // If the table already exists, BigQuery will overwrite the table data and + // use the schema from the load. + WRITE_TRUNCATE = 1; + + // If the table already exists, BigQuery will append data to the table. + WRITE_APPEND = 2; + } + + // Exporter destination. + oneof destination { + // Specified if sink is a BigQuery table. + BigQueryDestination big_query_destination = 2; + } + + // Required. The parent resource to export data from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // A filter to reduce results to a specific subset. Useful for exporting + // conversations with specific properties. + string filter = 3; + + // A fully qualified KMS key name for BigQuery tables protected by CMEK. + // Format: + // projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version} + string kms_key = 4; + + // Options for what to do if the destination table already exists. + WriteDisposition write_disposition = 5; +} + +// Metadata for an export insights operation. +message ExportInsightsDataMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original request for export. + ExportInsightsDataRequest request = 3; + + // Partial errors during export operation that might cause the operation + // output to be incomplete. + repeated google.rpc.Status partial_errors = 4; +} + +// Response for an export insights operation. +message ExportInsightsDataResponse { + +} + +// The request to create an issue model. +message CreateIssueModelRequest { + // Required. The parent resource of the issue model. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The issue model to create. + IssueModel issue_model = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata for creating an issue model. +message CreateIssueModelMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original request for creation. + CreateIssueModelRequest request = 3; +} + +// The request to update an issue model. +message UpdateIssueModelRequest { + // Required. The new values for the issue model. + IssueModel issue_model = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request to list issue models. +message ListIssueModelsRequest { + // Required. The parent resource of the issue model. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// The response of listing issue models. +message ListIssueModelsResponse { + // The issue models that match the request. + repeated IssueModel issue_models = 1; +} + +// The request to get an issue model. +message GetIssueModelRequest { + // Required. The name of the issue model to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + } + ]; +} + +// The request to delete an issue model. +message DeleteIssueModelRequest { + // Required. The name of the issue model to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + } + ]; +} + +// Metadata for deleting an issue model. +message DeleteIssueModelMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original request for deletion. + DeleteIssueModelRequest request = 3; +} + +// The request to deploy an issue model. +message DeployIssueModelRequest { + // Required. The issue model to deploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + } + ]; +} + +// The response to deploy an issue model. +message DeployIssueModelResponse { + +} + +// Metadata for deploying an issue model. +message DeployIssueModelMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original request for deployment. + DeployIssueModelRequest request = 3; +} + +// The request to undeploy an issue model. +message UndeployIssueModelRequest { + // Required. The issue model to undeploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + } + ]; +} + +// The response to undeploy an issue model. +message UndeployIssueModelResponse { + +} + +// Metadata for undeploying an issue model. +message UndeployIssueModelMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original request for undeployment. + UndeployIssueModelRequest request = 3; +} + +// The request to get an issue. +message GetIssueRequest { + // Required. The name of the issue to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Issue" + } + ]; +} + +// Request to list issues. +message ListIssuesRequest { + // Required. The parent resource of the issue. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + } + ]; +} + +// The response of listing issues. +message ListIssuesResponse { + // The issues that match the request. + repeated Issue issues = 1; +} + +// The request to update an issue. +message UpdateIssueRequest { + // Required. The new values for the issue. + Issue issue = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request to delete an issue. +message DeleteIssueRequest { + // Required. The name of the issue to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Issue" + } + ]; +} + +// Request to get statistics of an issue model. +message CalculateIssueModelStatsRequest { + // Required. The resource name of the issue model to query against. + string issue_model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + } + ]; +} + +// Response of querying an issue model's statistics. +message CalculateIssueModelStatsResponse { + // The latest label statistics for the queried issue model. Includes results + // on both training data and data labeled after deployment. + IssueModelLabelStats current_stats = 4; +} + +// Request to create a phrase matcher. +message CreatePhraseMatcherRequest { + // Required. The parent resource of the phrase matcher. Required. The location to create + // a phrase matcher for. + // Format: `projects//locations/` or + // `projects//locations/` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The phrase matcher resource to create. + PhraseMatcher phrase_matcher = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to list phrase matchers. +message ListPhraseMatchersRequest { + // Required. The parent resource of the phrase matcher. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of phrase matchers to return in the response. If this + // value is zero, the service will select a default size. A call might return + // fewer objects than requested. A non-empty `next_page_token` in the response + // indicates that more data is available. + int32 page_size = 2; + + // The value returned by the last `ListPhraseMatchersResponse`. This value + // indicates that this is a continuation of a prior `ListPhraseMatchers` call + // and that the system should return the next page of data. + string page_token = 3; + + // A filter to reduce results to a specific subset. Useful for querying + // phrase matchers with specific properties. + string filter = 4; +} + +// The response of listing phrase matchers. +message ListPhraseMatchersResponse { + // The phrase matchers that match the request. + repeated PhraseMatcher phrase_matchers = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request to get a a phrase matcher. +message GetPhraseMatcherRequest { + // Required. The name of the phrase matcher to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/PhraseMatcher" + } + ]; +} + +// The request to delete a phrase matcher. +message DeletePhraseMatcherRequest { + // Required. The name of the phrase matcher to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/PhraseMatcher" + } + ]; +} + +// The request to update a phrase matcher. +message UpdatePhraseMatcherRequest { + // Required. The new values for the phrase matcher. + PhraseMatcher phrase_matcher = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request to get project-level settings. +message GetSettingsRequest { + // Required. The name of the settings resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Settings" + } + ]; +} + +// The request to update project-level settings. +message UpdateSettingsRequest { + // Required. The new settings values. + Settings settings = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request to create a view. +message CreateViewRequest { + // Required. The parent resource of the view. Required. The location to create + // a view for. + // Format: `projects//locations/` or + // `projects//locations/` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The view resource to create. + View view = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request to get a view. +message GetViewRequest { + // Required. The name of the view to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/View" + } + ]; +} + +// The request to list views. +message ListViewsRequest { + // Required. The parent resource of the views. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of views to return in the response. If this + // value is zero, the service will select a default size. A call may return + // fewer objects than requested. A non-empty `next_page_token` in the response + // indicates that more data is available. + int32 page_size = 2; + + // The value returned by the last `ListViewsResponse`; indicates + // that this is a continuation of a prior `ListViews` call and + // the system should return the next page of data. + string page_token = 3; +} + +// The response of listing views. +message ListViewsResponse { + // The views that match the request. + repeated View views = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The request to update a view. +message UpdateViewRequest { + // Required. The new view. + View view = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request to delete a view. +message DeleteViewRequest { + // Required. The name of the view to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/View" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto b/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto new file mode 100644 index 00000000000..715eff61177 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto @@ -0,0 +1,1180 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.contactcenterinsights.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ContactCenterInsights.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/contactcenterinsights/v1;contactcenterinsights"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.contactcenterinsights.v1"; +option php_namespace = "Google\\Cloud\\ContactCenterInsights\\V1"; +option ruby_package = "Google::Cloud::ContactCenterInsights::V1"; +option (google.api.resource_definition) = { + type: "dialogflow.googleapis.com/Participant" + pattern: "projects/{project}/conversations/{conversation}/participants/{participant}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" +}; + +// The conversation resource. +message Conversation { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/Conversation" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}" + }; + + // Call-specific metadata. + message CallMetadata { + // The audio channel that contains the customer. + int32 customer_channel = 1; + + // The audio channel that contains the agent. + int32 agent_channel = 2; + } + + // A message representing the transcript of a conversation. + message Transcript { + // A segment of a full transcript. + message TranscriptSegment { + // Word-level info for words in a transcript. + message WordInfo { + // Time offset of the start of this word relative to the beginning of + // the total conversation. + google.protobuf.Duration start_offset = 1; + + // Time offset of the end of this word relative to the beginning of the + // total conversation. + google.protobuf.Duration end_offset = 2; + + // The word itself. Includes punctuation marks that surround the word. + string word = 3; + + // A confidence estimate between 0.0 and 1.0 of the fidelity of this + // word. A default value of 0.0 indicates that the value is unset. + float confidence = 4; + } + + // Metadata from Dialogflow relating to the current transcript segment. + message DialogflowSegmentMetadata { + // Whether the transcript segment was covered under the configured smart + // reply allowlist in Agent Assist. + bool smart_reply_allowlist_covered = 1; + } + + // The time that the message occurred, if provided. + google.protobuf.Timestamp message_time = 6; + + // The text of this segment. + string text = 1; + + // A confidence estimate between 0.0 and 1.0 of the fidelity of this + // segment. A default value of 0.0 indicates that the value is unset. + float confidence = 2; + + // A list of the word-specific information for each word in the segment. + repeated WordInfo words = 3; + + // The language code of this segment as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + string language_code = 4; + + // For conversations derived from multi-channel audio, this is the channel + // number corresponding to the audio from that channel. For + // audioChannelCount = N, its output values can range from '1' to 'N'. A + // channel tag of 0 indicates that the audio is mono. + int32 channel_tag = 5; + + // The participant of this segment. + ConversationParticipant segment_participant = 9; + + // CCAI metadata relating to the current transcript segment. + DialogflowSegmentMetadata dialogflow_segment_metadata = 10; + + // The sentiment for this transcript segment. + SentimentData sentiment = 11; + } + + // A list of sequential transcript segments that comprise the conversation. + repeated TranscriptSegment transcript_segments = 1; + } + + // Possible media for the conversation. + enum Medium { + // Default value, if unspecified will default to PHONE_CALL. + MEDIUM_UNSPECIFIED = 0; + + // The format for conversations that took place over the phone. + PHONE_CALL = 1; + + // The format for conversations that took place over chat. + CHAT = 2; + } + + // Metadata that applies to the conversation. + oneof metadata { + // Call-specific metadata. + CallMetadata call_metadata = 7; + } + + // A time to live expiration setting, can be either a specified timestamp or a + // duration from the time that the conversation creation request was received. + // Conversations with an expiration set will be removed up to 24 hours after + // the specified time. + oneof expiration { + // The time at which this conversation should expire. After this time, the + // conversation data and any associated analyses will be deleted. + google.protobuf.Timestamp expire_time = 15; + + // Input only. The TTL for this resource. If specified, then this TTL will + // be used to calculate the expire time. + google.protobuf.Duration ttl = 16 [(google.api.field_behavior) = INPUT_ONLY]; + } + + // Immutable. The resource name of the conversation. + // Format: + // projects/{project}/locations/{location}/conversations/{conversation} + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The source of the audio and transcription for the conversation. + ConversationDataSource data_source = 2; + + // Output only. The time at which the conversation was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the conversation was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The time at which the conversation started. + google.protobuf.Timestamp start_time = 17; + + // A user-specified language code for the conversation. + string language_code = 14; + + // An opaque, user-specified string representing the human agent who handled + // the conversation. + string agent_id = 5; + + // A map for the user to specify any custom fields. A maximum of 20 labels per + // conversation is allowed, with a maximum of 256 characters per entry. + map labels = 6; + + // Output only. The conversation transcript. + Transcript transcript = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The conversation medium, if unspecified will default to PHONE_CALL. + Medium medium = 9 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The duration of the conversation. + google.protobuf.Duration duration = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of turns in the conversation. + int32 turn_count = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The conversation's latest analysis, if one exists. + Analysis latest_analysis = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The annotations that were generated during the customer and agent + // interaction. + repeated RuntimeAnnotation runtime_annotations = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. All the matched Dialogflow intents in the call. The key corresponds to a + // Dialogflow intent, format: + // projects/{project}/agent/{agent}/intents/{intent} + map dialogflow_intents = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Obfuscated user ID which the customer sent to us. + string obfuscated_user_id = 21; +} + +// The analysis resource. +message Analysis { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/Analysis" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}" + }; + + // Immutable. The resource name of the analysis. + // Format: + // projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis} + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time at which the analysis was requested. + google.protobuf.Timestamp request_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the analysis was created, which occurs when the + // long-running operation completes. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The result of the analysis, which is populated when the analysis + // finishes. + AnalysisResult analysis_result = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // To select the annotators to run and the phrase matchers to use + // (if any). If not specified, all annotators will be run. + AnnotatorSelector annotator_selector = 8; +} + +// The conversation source, which is a combination of transcript and audio. +message ConversationDataSource { + // The source of the conversation. + oneof source { + // A Cloud Storage location specification for the audio and transcript. + GcsSource gcs_source = 1; + + // The source when the conversation comes from Dialogflow. + DialogflowSource dialogflow_source = 3; + } +} + +// A Cloud Storage source of conversation data. +message GcsSource { + // Cloud Storage URI that points to a file that contains the conversation + // audio. + string audio_uri = 1; + + // Immutable. Cloud Storage URI that points to a file that contains the conversation + // transcript. + string transcript_uri = 2 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A Dialogflow source of conversation data. +message DialogflowSource { + // Output only. The name of the Dialogflow conversation that this conversation + // resource is derived from. Format: + // projects/{project}/locations/{location}/conversations/{conversation} + string dialogflow_conversation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud Storage URI that points to a file that contains the conversation + // audio. + string audio_uri = 3; +} + +// The result of an analysis. +message AnalysisResult { + // Call-specific metadata created during analysis. + message CallAnalysisMetadata { + // A list of call annotations that apply to this call. + repeated CallAnnotation annotations = 2; + + // All the entities in the call. + map entities = 3; + + // Overall conversation-level sentiment for each channel of the call. + repeated ConversationLevelSentiment sentiments = 4; + + // All the matched intents in the call. + map intents = 6; + + // All the matched phrase matchers in the call. + map phrase_matchers = 7; + + // Overall conversation-level issue modeling result. + IssueModelResult issue_model_result = 8; + } + + // Metadata discovered during analysis. + oneof metadata { + // Call-specific metadata created by the analysis. + CallAnalysisMetadata call_analysis_metadata = 2; + } + + // The time at which the analysis ended. + google.protobuf.Timestamp end_time = 1; +} + +// Issue Modeling result on a conversation. +message IssueModelResult { + // Issue model that generates the result. + // Format: projects/{project}/locations/{location}/issueModels/{issue_model} + string issue_model = 1 [(google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + }]; + + // All the matched issues. + repeated IssueAssignment issues = 2; +} + +// One channel of conversation-level sentiment data. +message ConversationLevelSentiment { + // The channel of the audio that the data applies to. + int32 channel_tag = 1; + + // Data specifying sentiment. + SentimentData sentiment_data = 2; +} + +// Information about the issue. +message IssueAssignment { + // Resource name of the assigned issue. + string issue = 1; + + // Score indicating the likelihood of the issue assignment. + // currently bounded on [0,1]. + double score = 2; + + // Immutable. Display name of the assigned issue. This field is set at time of analyis + // and immutable since then. + string display_name = 3 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A piece of metadata that applies to a window of a call. +message CallAnnotation { + // The data in the annotation. + oneof data { + // Data specifying an interruption. + InterruptionData interruption_data = 10; + + // Data specifying sentiment. + SentimentData sentiment_data = 11; + + // Data specifying silence. + SilenceData silence_data = 12; + + // Data specifying a hold. + HoldData hold_data = 13; + + // Data specifying an entity mention. + EntityMentionData entity_mention_data = 15; + + // Data specifying an intent match. + IntentMatchData intent_match_data = 16; + + // Data specifying a phrase match. + PhraseMatchData phrase_match_data = 17; + + // Data specifying an issue match. + IssueMatchData issue_match_data = 18; + } + + // The channel of the audio where the annotation occurs. For single-channel + // audio, this field is not populated. + int32 channel_tag = 1; + + // The boundary in the conversation where the annotation starts, inclusive. + AnnotationBoundary annotation_start_boundary = 4; + + // The boundary in the conversation where the annotation ends, inclusive. + AnnotationBoundary annotation_end_boundary = 5; +} + +// A point in a conversation that marks the start or the end of an annotation. +message AnnotationBoundary { + // A detailed boundary, which describes a more specific point. + oneof detailed_boundary { + // The word index of this boundary with respect to the first word in the + // transcript piece. This index starts at zero. + int32 word_index = 3; + } + + // The index in the sequence of transcribed pieces of the conversation where + // the boundary is located. This index starts at zero. + int32 transcript_index = 1; +} + +// The data for an entity annotation. +// Represents a phrase in the conversation that is a known entity, such +// as a person, an organization, or location. +message Entity { + // The type of the entity. For most entity types, the associated metadata is a + // Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table + // below lists the associated fields for entities that have different + // metadata. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Person. + PERSON = 1; + + // Location. + LOCATION = 2; + + // Organization. + ORGANIZATION = 3; + + // Event. + EVENT = 4; + + // Artwork. + WORK_OF_ART = 5; + + // Consumer product. + CONSUMER_GOOD = 6; + + // Other types of entities. + OTHER = 7; + + // Phone number. + // + // The metadata lists the phone number (formatted according to local + // convention), plus whichever additional elements appear in the text: + // + // * `number` - The actual number, broken down into sections according to + // local convention. + // * `national_prefix` - Country code, if detected. + // * `area_code` - Region or area code, if detected. + // * `extension` - Phone extension (to be dialed after connection), if + // detected. + PHONE_NUMBER = 9; + + // Address. + // + // The metadata identifies the street number and locality plus whichever + // additional elements appear in the text: + // + // * `street_number` - Street number. + // * `locality` - City or town. + // * `street_name` - Street/route name, if detected. + // * `postal_code` - Postal code, if detected. + // * `country` - Country, if detected. + // * `broad_region` - Administrative area, such as the state, if detected. + // * `narrow_region` - Smaller administrative area, such as county, if + // detected. + // * `sublocality` - Used in Asian addresses to demark a district within a + // city, if detected. + ADDRESS = 10; + + // Date. + // + // The metadata identifies the components of the date: + // + // * `year` - Four digit year, if detected. + // * `month` - Two digit month number, if detected. + // * `day` - Two digit day number, if detected. + DATE = 11; + + // Number. + // + // The metadata is the number itself. + NUMBER = 12; + + // Price. + // + // The metadata identifies the `value` and `currency`. + PRICE = 13; + } + + // The representative name for the entity. + string display_name = 1; + + // The entity type. + Type type = 2; + + // Metadata associated with the entity. + // + // For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) + // and Knowledge Graph MID (`mid`), if they are available. For the metadata + // associated with other entity types, see the Type table below. + map metadata = 3; + + // The salience score associated with the entity in the [0, 1.0] range. + // + // The salience score for an entity provides information about the + // importance or centrality of that entity to the entire document text. + // Scores closer to 0 are less salient, while scores closer to 1.0 are highly + // salient. + float salience = 4; + + // The aggregate sentiment expressed for this entity in the conversation. + SentimentData sentiment = 5; +} + +// The data for an intent. +// Represents a detected intent in the conversation, for example MAKES_PROMISE. +message Intent { + // The unique identifier of the intent. + string id = 1; + + // The human-readable name of the intent. + string display_name = 2; +} + +// The data for a matched phrase matcher. +// Represents information identifying a phrase matcher for a given match. +message PhraseMatchData { + // The unique identifier (the resource name) of the phrase matcher. + string phrase_matcher = 1; + + // The human-readable name of the phrase matcher. + string display_name = 2; +} + +// The data for a Dialogflow intent. +// Represents a detected intent in the conversation, e.g. MAKES_PROMISE. +message DialogflowIntent { + // The human-readable name of the intent. + string display_name = 1; +} + +// The data for an interruption annotation. +message InterruptionData { + +} + +// The data for a silence annotation. +message SilenceData { + +} + +// The data for a hold annotation. +message HoldData { + +} + +// The data for an entity mention annotation. +// This represents a mention of an `Entity` in the conversation. +message EntityMentionData { + // The supported types of mentions. + enum MentionType { + // Unspecified. + MENTION_TYPE_UNSPECIFIED = 0; + + // Proper noun. + PROPER = 1; + + // Common noun (or noun compound). + COMMON = 2; + } + + // The key of this entity in conversation entities. + // Can be used to retrieve the exact `Entity` this mention is attached to. + string entity_unique_id = 1; + + // The type of the entity mention. + MentionType type = 2; + + // Sentiment expressed for this mention of the entity. + SentimentData sentiment = 3; +} + +// The data for an intent match. +// Represents an intent match for a text segment in the conversation. A text +// segment can be part of a sentence, a complete sentence, or an utterance +// with multiple sentences. +message IntentMatchData { + // The id of the matched intent. + // Can be used to retrieve the corresponding intent information. + string intent_unique_id = 1; +} + +// The data for a sentiment annotation. +message SentimentData { + // A non-negative number from 0 to infinity which represents the abolute + // magnitude of sentiment regardless of score. + float magnitude = 1; + + // The sentiment score between -1.0 (negative) and 1.0 (positive). + float score = 2; +} + +// The data for an issue match annotation. +message IssueMatchData { + // Information about the issue's assignment. + IssueAssignment issue_assignment = 1; +} + +// The issue model resource. +message IssueModel { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + pattern: "projects/{project}/locations/{location}/issueModels/{issue_model}" + }; + + // Configs for the input data used to create the issue model. + message InputDataConfig { + // Medium of conversations used in training data. This field is being + // deprecated. To specify the medium to be used in training a new issue + // model, set the `medium` field on `filter`. + Conversation.Medium medium = 1 [deprecated = true]; + + // Output only. Number of conversations used in training. Output only. + int64 training_conversations_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A filter to reduce the conversations used for training the model to a + // specific subset. + string filter = 3; + } + + // State of the model. + enum State { + // Unspecified. + STATE_UNSPECIFIED = 0; + + // Model is not deployed but is ready to deploy. + UNDEPLOYED = 1; + + // Model is being deployed. + DEPLOYING = 2; + + // Model is deployed and is ready to be used. A model can only be used in + // analysis if it's in this state. + DEPLOYED = 3; + + // Model is being undeployed. + UNDEPLOYING = 4; + + // Model is being deleted. + DELETING = 5; + } + + // Immutable. The resource name of the issue model. + // Format: + // projects/{project}/locations/{location}/issueModels/{issue_model} + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The representative name for the issue model. + string display_name = 2; + + // Output only. The time at which this issue model was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the issue model was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the model. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configs for the input data that used to create the issue model. + InputDataConfig input_data_config = 6; + + // Output only. Immutable. The issue model's label statistics on its training data. + IssueModelLabelStats training_stats = 7 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// The issue resource. +message Issue { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/Issue" + pattern: "projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}" + }; + + // Immutable. The resource name of the issue. + // Format: + // projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue} + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The representative name for the issue. + string display_name = 2; + + // Output only. The time at which this issue was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time that this issue was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource names of the sample representative utterances that match to this + // issue. + repeated string sample_utterances = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Aggregated statistics about an issue model. +message IssueModelLabelStats { + // Aggregated statistics about an issue. + message IssueStats { + // Issue resource. + // Format: + // projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue} + string issue = 1; + + // Number of conversations attached to the issue at this point in time. + int64 labeled_conversations_count = 2; + + // Display name of the issue. + string display_name = 3; + } + + // Number of conversations the issue model has analyzed at this point in time. + int64 analyzed_conversations_count = 1; + + // Number of analyzed conversations for which no issue was applicable at this + // point in time. + int64 unclassified_conversations_count = 2; + + // Statistics on each issue. Key is the issue's resource name. + map issue_stats = 3; +} + +// The phrase matcher resource. +message PhraseMatcher { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/PhraseMatcher" + pattern: "projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}" + }; + + // Specifies how to combine each phrase match rule group to determine whether + // there is a match. + enum PhraseMatcherType { + // Unspecified. + PHRASE_MATCHER_TYPE_UNSPECIFIED = 0; + + // Must meet all phrase match rule groups or there is no match. + ALL_OF = 1; + + // If any of the phrase match rule groups are met, there is a match. + ANY_OF = 2; + } + + // The resource name of the phrase matcher. + // Format: + // projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher} + string name = 1; + + // Output only. Immutable. The revision ID of the phrase matcher. + // A new revision is committed whenever the matcher is changed, except when it + // is activated or deactivated. A server generated random ID will be used. + // Example: locations/global/phraseMatchers/my-first-matcher@1234567 + string revision_id = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // The customized version tag to use for the phrase matcher. If not specified, + // it will default to `revision_id`. + string version_tag = 3; + + // Output only. The timestamp of when the revision was created. It is also the create time + // when a new matcher is added. + google.protobuf.Timestamp revision_create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The human-readable name of the phrase matcher. + string display_name = 5; + + // Required. The type of this phrase matcher. + PhraseMatcherType type = 6 [(google.api.field_behavior) = REQUIRED]; + + // Applies the phrase matcher only when it is active. + bool active = 7; + + // A list of phase match rule groups that are included in this matcher. + repeated PhraseMatchRuleGroup phrase_match_rule_groups = 8; + + // Output only. The most recent time at which the activation status was updated. + google.protobuf.Timestamp activation_update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The role whose utterances the phrase matcher should be matched + // against. If the role is ROLE_UNSPECIFIED it will be matched against any + // utterances in the transcript. + ConversationParticipant.Role role_match = 10; + + // Output only. The most recent time at which the phrase matcher was updated. + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A message representing a rule in the phrase matcher. +message PhraseMatchRuleGroup { + // Specifies how to combine each phrase match rule for whether there is a + // match. + enum PhraseMatchRuleGroupType { + // Unspecified. + PHRASE_MATCH_RULE_GROUP_TYPE_UNSPECIFIED = 0; + + // Must meet all phrase match rules or there is no match. + ALL_OF = 1; + + // If any of the phrase match rules are met, there is a match. + ANY_OF = 2; + } + + // Required. The type of this phrase match rule group. + PhraseMatchRuleGroupType type = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of phase match rules that are included in this group. + repeated PhraseMatchRule phrase_match_rules = 2; +} + +// The data for a phrase match rule. +message PhraseMatchRule { + // Required. The phrase to be matched. + string query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Specifies whether the phrase must be missing from the transcript segment or + // present in the transcript segment. + bool negated = 2; + + // Provides additional information about the rule that specifies how to apply + // the rule. + PhraseMatchRuleConfig config = 3; +} + +// Configuration information of a phrase match rule. +message PhraseMatchRuleConfig { + // The configuration of the phrase match rule. + oneof config { + // The configuration for the exact match rule. + ExactMatchConfig exact_match_config = 1; + } +} + +// Exact match configuration. +message ExactMatchConfig { + // Whether to consider case sensitivity when performing an exact match. + bool case_sensitive = 1; +} + +// The settings resource. +message Settings { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/Settings" + pattern: "projects/{project}/locations/{location}/settings" + }; + + // Default configuration when creating Analyses in Insights. + message AnalysisConfig { + // Percentage of conversations created using Dialogflow runtime integration + // to analyze automatically, between [0, 100]. + double runtime_integration_analysis_percentage = 1; + + // To select the annotators to run and the phrase matchers to use + // (if any). If not specified, all annotators will be run. + AnnotatorSelector annotator_selector = 5; + } + + // Immutable. The resource name of the settings resource. + // Format: + // projects/{project}/locations/{location}/settings + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time at which the settings was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the settings were last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A language code to be applied to each transcript segment unless the segment + // already specifies a language code. Language code defaults to "en-US" if it + // is neither specified on the segment nor here. + string language_code = 4; + + // The default TTL for newly-created conversations. If a conversation has a + // specified expiration, that value will be used instead. Changing this + // value will not change the expiration of existing conversations. + // Conversations with no expire time persist until they are deleted. + google.protobuf.Duration conversation_ttl = 5; + + // A map that maps a notification trigger to a Pub/Sub topic. Each time a + // specified trigger occurs, Insights will notify the corresponding Pub/Sub + // topic. + // + // Keys are notification triggers. Supported keys are: + // + // * "all-triggers": Notify each time any of the supported triggers occurs. + // * "create-analysis": Notify each time an analysis is created. + // * "create-conversation": Notify each time a conversation is created. + // * "export-insights-data": Notify each time an export is complete. + // * "update-conversation": Notify each time a conversation is updated via + // UpdateConversation. + // + // Values are Pub/Sub topics. The format of each Pub/Sub topic is: + // projects/{project}/topics/{topic} + map pubsub_notification_settings = 6; + + // Default analysis settings. + AnalysisConfig analysis_config = 7; +} + +// An annotation that was generated during the customer and agent interaction. +message RuntimeAnnotation { + // The data in the annotation. + oneof data { + // Agent Assist Article Suggestion data. + ArticleSuggestionData article_suggestion = 6; + + // Agent Assist FAQ answer data. + FaqAnswerData faq_answer = 7; + + // Agent Assist Smart Reply data. + SmartReplyData smart_reply = 8; + + // Agent Assist Smart Compose suggestion data. + SmartComposeSuggestionData smart_compose_suggestion = 9; + + // Dialogflow interaction data. + DialogflowInteractionData dialogflow_interaction = 10; + } + + // The unique identifier of the annotation. + // Format: + // projects/{project}/locations/{location}/conversationDatasets/{dataset}/conversationDataItems/{data_item}/conversationAnnotations/{annotation} + string annotation_id = 1; + + // The time at which this annotation was created. + google.protobuf.Timestamp create_time = 2; + + // The boundary in the conversation where the annotation starts, inclusive. + AnnotationBoundary start_boundary = 3; + + // The boundary in the conversation where the annotation ends, inclusive. + AnnotationBoundary end_boundary = 4; + + // The feedback that the customer has about the answer in `data`. + AnswerFeedback answer_feedback = 5; +} + +// The feedback that the customer has about a certain answer in the +// conversation. +message AnswerFeedback { + // The correctness level of an answer. + enum CorrectnessLevel { + // Correctness level unspecified. + CORRECTNESS_LEVEL_UNSPECIFIED = 0; + + // Answer is totally wrong. + NOT_CORRECT = 1; + + // Answer is partially correct. + PARTIALLY_CORRECT = 2; + + // Answer is fully correct. + FULLY_CORRECT = 3; + } + + // The correctness level of an answer. + CorrectnessLevel correctness_level = 1; + + // Indicates whether an answer or item was clicked by the human agent. + bool clicked = 2; + + // Indicates whether an answer or item was displayed to the human agent in the + // agent desktop UI. + bool displayed = 3; +} + +// Agent Assist Article Suggestion data. +message ArticleSuggestionData { + // Article title. + string title = 1; + + // Article URI. + string uri = 2; + + // The system's confidence score that this article is a good match for this + // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely + // certain). + float confidence_score = 3; + + // Map that contains metadata about the Article Suggestion and the document + // that it originates from. + map metadata = 4; + + // The name of the answer record. + // Format: + // projects/{project}/locations/{location}/answerRecords/{answer_record} + string query_record = 5; + + // The knowledge document that this answer was extracted from. + // Format: + // projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} + string source = 6; +} + +// Agent Assist frequently-asked-question answer data. +message FaqAnswerData { + // The piece of text from the `source` knowledge base document. + string answer = 1; + + // The system's confidence score that this answer is a good match for this + // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely + // certain). + float confidence_score = 2; + + // The corresponding FAQ question. + string question = 3; + + // Map that contains metadata about the FAQ answer and the document that + // it originates from. + map metadata = 4; + + // The name of the answer record. + // Format: + // projects/{project}/locations/{location}/answerRecords/{answer_record} + string query_record = 5; + + // The knowledge document that this answer was extracted from. + // Format: + // projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}. + string source = 6; +} + +// Agent Assist Smart Reply data. +message SmartReplyData { + // The content of the reply. + string reply = 1; + + // The system's confidence score that this reply is a good match for this + // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely + // certain). + double confidence_score = 2; + + // Map that contains metadata about the Smart Reply and the document from + // which it originates. + map metadata = 3; + + // The name of the answer record. + // Format: + // projects/{project}/locations/{location}/answerRecords/{answer_record} + string query_record = 4; +} + +// Agent Assist Smart Compose suggestion data. +message SmartComposeSuggestionData { + // The content of the suggestion. + string suggestion = 1; + + // The system's confidence score that this suggestion is a good match for this + // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely + // certain). + double confidence_score = 2; + + // Map that contains metadata about the Smart Compose suggestion and the + // document from which it originates. + map metadata = 3; + + // The name of the answer record. + // Format: + // projects/{project}/locations/{location}/answerRecords/{answer_record} + string query_record = 4; +} + +// Dialogflow interaction data. +message DialogflowInteractionData { + // The Dialogflow intent resource path. Format: + // projects/{project}/agent/{agent}/intents/{intent} + string dialogflow_intent_id = 1; + + // The confidence of the match ranging from 0.0 (completely uncertain) to 1.0 + // (completely certain). + float confidence = 2; +} + +// The call participant speaking for a given utterance. +message ConversationParticipant { + // The role of the participant. + enum Role { + // Participant's role is not set. + ROLE_UNSPECIFIED = 0; + + // Participant is a human agent. + HUMAN_AGENT = 1; + + // Participant is an automated agent. + AUTOMATED_AGENT = 2; + + // Participant is an end user who conversed with the contact center. + END_USER = 3; + + // Participant is either a human or automated agent. + ANY_AGENT = 4; + } + + oneof participant { + // The name of the participant provided by Dialogflow. Format: + // projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} + string dialogflow_participant_name = 5 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + }]; + + // A user-specified ID representing the participant. + string user_id = 6; + } + + // Deprecated. Use `dialogflow_participant_name` instead. + // The name of the Dialogflow participant. Format: + // projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} + string dialogflow_participant = 1 [deprecated = true]; + + // Obfuscated user ID from Dialogflow. + string obfuscated_external_user_id = 3; + + // The role of the participant. + Role role = 2; +} + +// The View resource. +message View { + option (google.api.resource) = { + type: "contactcenterinsights.googleapis.com/View" + pattern: "projects/{project}/locations/{location}/views/{view}" + }; + + // Immutable. The resource name of the view. + // Format: + // projects/{project}/locations/{location}/views/{view} + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // The human-readable display name of the view. + string display_name = 2; + + // Output only. The time at which this view was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most recent time at which the view was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // String with specific view properties. + string value = 5; +} + +// Selector of all available annotators and phrase matchers to run. +message AnnotatorSelector { + // Whether to run the interruption annotator. + bool run_interruption_annotator = 1; + + // Whether to run the silence annotator. + bool run_silence_annotator = 2; + + // Whether to run the active phrase matcher annotator(s). + bool run_phrase_matcher_annotator = 3; + + // The list of phrase matchers to run. If not provided, all active phrase + // matchers will be used. If inactive phrase matchers are provided, they will + // not be used. Phrase matchers will be run only if + // run_phrase_matcher_annotator is set to true. Format: + // projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher} + repeated string phrase_matchers = 4 [(google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/PhraseMatcher" + }]; + + // Whether to run the sentiment annotator. + bool run_sentiment_annotator = 5; + + // Whether to run the entity annotator. + bool run_entity_annotator = 6; + + // Whether to run the intent annotator. + bool run_intent_annotator = 7; + + // Whether to run the issue model annotator. A model should have already been + // deployed for this to take effect. + bool run_issue_model_annotator = 8; + + // The issue model to run. If not provided, the most recently deployed topic + // model will be used. The provided issue model will only be used for + // inference if the issue model is deployed and if run_issue_model_annotator + // is set to true. If more than one issue model is provided, only the first + // provided issue model will be used for inference. + repeated string issue_models = 10 [(google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + }]; +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js new file mode 100644 index 00000000000..2a55a01eac3 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js @@ -0,0 +1,78 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, filter, analysisPercentage) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource to create analyses in. + */ + // const parent = 'abc123' + /** + * Required. Filter used to select the subset of conversations to analyze. + */ + // const filter = 'abc123' + /** + * Required. Percentage of selected conversation to analyze, between + * 0, 100. + */ + // const analysisPercentage = 1234 + /** + * To select the annotators to run and the phrase matchers to use + * (if any). If not specified, all annotators will be run. + */ + // const annotatorSelector = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callBulkAnalyzeConversations() { + // Construct request + const request = { + parent, + filter, + analysisPercentage, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.bulkAnalyzeConversations(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBulkAnalyzeConversations(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js new file mode 100644 index 00000000000..c672863a42b --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(issueModel) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the issue model to query against. + */ + // const issueModel = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCalculateIssueModelStats() { + // Construct request + const request = { + issueModel, + }; + + // Run request + const response = await contactcenterinsightsClient.calculateIssueModelStats(request); + console.log(response); + } + + callCalculateIssueModelStats(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js new file mode 100644 index 00000000000..8935fc364ac --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(location) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location of the conversations. + */ + // const location = 'abc123' + /** + * A filter to reduce results to a specific subset. This field is useful for + * getting statistics about conversations with specific properties. + */ + // const filter = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCalculateStats() { + // Construct request + const request = { + location, + }; + + // Run request + const response = await contactcenterinsightsClient.calculateStats(request); + console.log(response); + } + + callCalculateStats(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js new file mode 100644 index 00000000000..679fe549909 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, analysis) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the analysis. + */ + // const parent = 'abc123' + /** + * Required. The analysis to create. + */ + // const analysis = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCreateAnalysis() { + // Construct request + const request = { + parent, + analysis, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.createAnalysis(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAnalysis(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js new file mode 100644 index 00000000000..92ff6b7db32 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, conversation) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the conversation. + */ + // const parent = 'abc123' + /** + * Required. The conversation resource to create. + */ + // const conversation = {} + /** + * A unique ID for the new conversation. This ID will become the final + * component of the conversation's resource name. If no ID is specified, a + * server-generated ID will be used. + * This value should be 4-64 characters and must match the regular + * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-` + */ + // const conversationId = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCreateConversation() { + // Construct request + const request = { + parent, + conversation, + }; + + // Run request + const response = await contactcenterinsightsClient.createConversation(request); + console.log(response); + } + + callCreateConversation(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js new file mode 100644 index 00000000000..5dbcb70672f --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, issueModel) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the issue model. + */ + // const parent = 'abc123' + /** + * Required. The issue model to create. + */ + // const issueModel = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCreateIssueModel() { + // Construct request + const request = { + parent, + issueModel, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.createIssueModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateIssueModel(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js new file mode 100644 index 00000000000..0564e15f0c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, phraseMatcher) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the phrase matcher. Required. The location to create + * a phrase matcher for. + * Format: `projects//locations/` or + * `projects//locations/` + */ + // const parent = 'abc123' + /** + * Required. The phrase matcher resource to create. + */ + // const phraseMatcher = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCreatePhraseMatcher() { + // Construct request + const request = { + parent, + phraseMatcher, + }; + + // Run request + const response = await contactcenterinsightsClient.createPhraseMatcher(request); + console.log(response); + } + + callCreatePhraseMatcher(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js new file mode 100644 index 00000000000..6faa48a506f --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js @@ -0,0 +1,69 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, view) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the view. Required. The location to create + * a view for. + * Format: `projects//locations/` or + * `projects//locations/` + */ + // const parent = 'abc123' + /** + * Required. The view resource to create. + */ + // const view = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callCreateView() { + // Construct request + const request = { + parent, + view, + }; + + // Run request + const response = await contactcenterinsightsClient.createView(request); + console.log(response); + } + + callCreateView(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js new file mode 100644 index 00000000000..1608d0b6918 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the analysis to delete. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeleteAnalysis() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.deleteAnalysis(request); + console.log(response); + } + + callDeleteAnalysis(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js new file mode 100644 index 00000000000..6afcbbccd01 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the conversation to delete. + */ + // const name = 'abc123' + /** + * If set to true, all of this conversation's analyses will also be deleted. + * Otherwise, the request will only succeed if the conversation has no + * analyses. + */ + // const force = true + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeleteConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.deleteConversation(request); + console.log(response); + } + + callDeleteConversation(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue.js new file mode 100644 index 00000000000..b15837c83cf --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the issue to delete. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeleteIssue() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.deleteIssue(request); + console.log(response); + } + + callDeleteIssue(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js new file mode 100644 index 00000000000..1c193bf1d0c --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the issue model to delete. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeleteIssueModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.deleteIssueModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteIssueModel(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js new file mode 100644 index 00000000000..da8bb0ea342 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase matcher to delete. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeletePhraseMatcher() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.deletePhraseMatcher(request); + console.log(response); + } + + callDeletePhraseMatcher(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js new file mode 100644 index 00000000000..f16c9572571 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the view to delete. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeleteView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.deleteView(request); + console.log(response); + } + + callDeleteView(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js new file mode 100644 index 00000000000..720266cc2d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The issue model to deploy. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callDeployIssueModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.deployIssueModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployIssueModel(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js new file mode 100644 index 00000000000..a217af60a77 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Specified if sink is a BigQuery table. + */ + // const bigQueryDestination = {} + /** + * Required. The parent resource to export data from. + */ + // const parent = 'abc123' + /** + * A filter to reduce results to a specific subset. Useful for exporting + * conversations with specific properties. + */ + // const filter = 'abc123' + /** + * A fully qualified KMS key name for BigQuery tables protected by CMEK. + * Format: + * projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version} + */ + // const kmsKey = 'abc123' + /** + * Options for what to do if the destination table already exists. + */ + // const writeDisposition = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callExportInsightsData() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.exportInsightsData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportInsightsData(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js new file mode 100644 index 00000000000..9352b396b22 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the analysis to get. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetAnalysis() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getAnalysis(request); + console.log(response); + } + + callGetAnalysis(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js new file mode 100644 index 00000000000..4c33825e6b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the conversation to get. + */ + // const name = 'abc123' + /** + * The level of details of the conversation. Default is `FULL`. + */ + // const view = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetConversation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getConversation(request); + console.log(response); + } + + callGetConversation(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js new file mode 100644 index 00000000000..1862cc15195 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the issue to get. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetIssue() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getIssue(request); + console.log(response); + } + + callGetIssue(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js new file mode 100644 index 00000000000..014e48e8c94 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the issue model to get. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetIssueModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getIssueModel(request); + console.log(response); + } + + callGetIssueModel(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js new file mode 100644 index 00000000000..07419bb40b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the phrase matcher to get. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetPhraseMatcher() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getPhraseMatcher(request); + console.log(response); + } + + callGetPhraseMatcher(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js new file mode 100644 index 00000000000..4819fa4c657 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the settings resource to get. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getSettings(request); + console.log(response); + } + + callGetSettings(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js new file mode 100644 index 00000000000..5e332347813 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the view to get. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callGetView() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await contactcenterinsightsClient.getView(request); + console.log(response); + } + + callGetView(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.ingest_conversations.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.ingest_conversations.js new file mode 100644 index 00000000000..4b2a93c9f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.ingest_conversations.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A cloud storage bucket source. + */ + // const gcsSource = {} + /** + * Configuration for when `source` contains conversation transcripts. + */ + // const transcriptObjectConfig = {} + /** + * Required. The parent resource for new conversations. + */ + // const parent = 'abc123' + /** + * Configuration that applies to all conversations. + */ + // const conversationConfig = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callIngestConversations() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.ingestConversations(request); + const [response] = await operation.promise(); + console.log(response); + } + + callIngestConversations(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js new file mode 100644 index 00000000000..951d859cb28 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the analyses. + */ + // const parent = 'abc123' + /** + * The maximum number of analyses to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListAnalysesResponse`; indicates + * that this is a continuation of a prior `ListAnalyses` call and + * the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + */ + // const filter = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callListAnalyses() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await contactcenterinsightsClient.listAnalysesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAnalyses(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js new file mode 100644 index 00000000000..a7328a9ea27 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the conversation. + */ + // const parent = 'abc123' + /** + * The maximum number of conversations to return in the response. A valid page + * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * unspecified, a default page size of 100 will be chosen. Note that a call + * might return fewer results than the requested page size. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListConversationsResponse`. This value + * indicates that this is a continuation of a prior `ListConversations` call + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + */ + // const filter = 'abc123' + /** + * The level of details of the conversation. Default is `BASIC`. + */ + // const view = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callListConversations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await contactcenterinsightsClient.listConversationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConversations(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js new file mode 100644 index 00000000000..c493e90cd97 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the issue model. + */ + // const parent = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callListIssueModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await contactcenterinsightsClient.listIssueModels(request); + console.log(response); + } + + callListIssueModels(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js new file mode 100644 index 00000000000..3dd60cb31e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the issue. + */ + // const parent = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callListIssues() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await contactcenterinsightsClient.listIssues(request); + console.log(response); + } + + callListIssues(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js new file mode 100644 index 00000000000..d18d56dabe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the phrase matcher. + */ + // const parent = 'abc123' + /** + * The maximum number of phrase matchers to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListPhraseMatchersResponse`. This value + * indicates that this is a continuation of a prior `ListPhraseMatchers` call + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + /** + * A filter to reduce results to a specific subset. Useful for querying + * phrase matchers with specific properties. + */ + // const filter = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callListPhraseMatchers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await contactcenterinsightsClient.listPhraseMatchersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPhraseMatchers(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js new file mode 100644 index 00000000000..b01eabb3c9a --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the views. + */ + // const parent = 'abc123' + /** + * The maximum number of views to return in the response. If this + * value is zero, the service will select a default size. A call may return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListViewsResponse`; indicates + * that this is a continuation of a prior `ListViews` call and + * the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callListViews() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await contactcenterinsightsClient.listViewsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListViews(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js new file mode 100644 index 00000000000..8ec02172b6b --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The issue model to undeploy. + */ + // const name = 'abc123' + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUndeployIssueModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await contactcenterinsightsClient.undeployIssueModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployIssueModel(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js new file mode 100644 index 00000000000..53be2c18b81 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(conversation) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values for the conversation. + */ + // const conversation = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUpdateConversation() { + // Construct request + const request = { + conversation, + }; + + // Run request + const response = await contactcenterinsightsClient.updateConversation(request); + console.log(response); + } + + callUpdateConversation(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js new file mode 100644 index 00000000000..e01afb85cc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(issue) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values for the issue. + */ + // const issue = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUpdateIssue() { + // Construct request + const request = { + issue, + }; + + // Run request + const response = await contactcenterinsightsClient.updateIssue(request); + console.log(response); + } + + callUpdateIssue(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js new file mode 100644 index 00000000000..13e04b841c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(issueModel) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values for the issue model. + */ + // const issueModel = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUpdateIssueModel() { + // Construct request + const request = { + issueModel, + }; + + // Run request + const response = await contactcenterinsightsClient.updateIssueModel(request); + console.log(response); + } + + callUpdateIssueModel(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js new file mode 100644 index 00000000000..b33b4cc0115 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(phraseMatcher) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values for the phrase matcher. + */ + // const phraseMatcher = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUpdatePhraseMatcher() { + // Construct request + const request = { + phraseMatcher, + }; + + // Run request + const response = await contactcenterinsightsClient.updatePhraseMatcher(request); + console.log(response); + } + + callUpdatePhraseMatcher(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js new file mode 100644 index 00000000000..f64596152fe --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(settings, updateMask) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new settings values. + */ + // const settings = {} + /** + * Required. The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUpdateSettings() { + // Construct request + const request = { + settings, + updateMask, + }; + + // Run request + const response = await contactcenterinsightsClient.updateSettings(request); + console.log(response); + } + + callUpdateSettings(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js new file mode 100644 index 00000000000..809e22badf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js @@ -0,0 +1,65 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(view) { + // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new view. + */ + // const view = {} + /** + * The list of fields to be updated. + */ + // const updateMask = {} + + // Imports the Contactcenterinsights library + const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; + + // Instantiates a client + const contactcenterinsightsClient = new ContactCenterInsightsClient(); + + async function callUpdateView() { + // Construct request + const request = { + view, + }; + + // Run request + const response = await contactcenterinsightsClient.updateView(request); + console.log(response); + } + + callUpdateView(); + // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json new file mode 100644 index 00000000000..a8c3b679304 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json @@ -0,0 +1,1643 @@ +{ + "clientLibrary": { + "name": "nodejs-contactcenterinsights", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.contactcenterinsights.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async", + "title": "ContactCenterInsights createConversation Sample", + "origin": "API_DEFINITION", + "description": " Creates a conversation.", + "canonical": true, + "file": "contact_center_insights.create_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateConversation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversation", + "type": ".google.cloud.contactcenterinsights.v1.Conversation" + }, + { + "name": "conversation_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Conversation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CreateConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateConversation", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async", + "title": "ContactCenterInsights updateConversation Sample", + "origin": "API_DEFINITION", + "description": " Updates a conversation.", + "canonical": true, + "file": "contact_center_insights.update_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateConversation", + "async": true, + "parameters": [ + { + "name": "conversation", + "type": ".google.cloud.contactcenterinsights.v1.Conversation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Conversation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UpdateConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateConversation", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async", + "title": "ContactCenterInsights getConversation Sample", + "origin": "API_DEFINITION", + "description": " Gets a conversation.", + "canonical": true, + "file": "contact_center_insights.get_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetConversation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.contactcenterinsights.v1.ConversationView" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Conversation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetConversation", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async", + "title": "ContactCenterInsights listConversations Sample", + "origin": "API_DEFINITION", + "description": " Lists conversations.", + "canonical": true, + "file": "contact_center_insights.list_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListConversations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.contactcenterinsights.v1.ConversationView" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.ListConversationsResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ListConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListConversations", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async", + "title": "ContactCenterInsights deleteConversation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a conversation.", + "canonical": true, + "file": "contact_center_insights.delete_conversation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteConversation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeleteConversation", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteConversation", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async", + "title": "ContactCenterInsights createAnalysis Sample", + "origin": "API_DEFINITION", + "description": " Creates an analysis. The long running operation is done when the analysis has completed.", + "canonical": true, + "file": "contact_center_insights.create_analysis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAnalysis", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateAnalysis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "analysis", + "type": ".google.cloud.contactcenterinsights.v1.Analysis" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CreateAnalysis", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateAnalysis", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async", + "title": "ContactCenterInsights getAnalysis Sample", + "origin": "API_DEFINITION", + "description": " Gets an analysis.", + "canonical": true, + "file": "contact_center_insights.get_analysis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnalysis", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetAnalysis", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Analysis", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetAnalysis", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetAnalysis", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async", + "title": "ContactCenterInsights listAnalyses Sample", + "origin": "API_DEFINITION", + "description": " Lists analyses.", + "canonical": true, + "file": "contact_center_insights.list_analyses.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAnalyses", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListAnalyses", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.ListAnalysesResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ListAnalyses", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListAnalyses", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async", + "title": "ContactCenterInsights deleteAnalysis Sample", + "origin": "API_DEFINITION", + "description": " Deletes an analysis.", + "canonical": true, + "file": "contact_center_insights.delete_analysis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAnalysis", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteAnalysis", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeleteAnalysis", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteAnalysis", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async", + "title": "ContactCenterInsights bulkAnalyzeConversations Sample", + "origin": "API_DEFINITION", + "description": " Analyzes multiple conversations in a single request.", + "canonical": true, + "file": "contact_center_insights.bulk_analyze_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BulkAnalyzeConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "analysis_percentage", + "type": "TYPE_FLOAT" + }, + { + "name": "annotator_selector", + "type": ".google.cloud.contactcenterinsights.v1.AnnotatorSelector" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "BulkAnalyzeConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversations", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async", + "title": "ContactCenterInsights ingestConversations Sample", + "origin": "API_DEFINITION", + "description": " Imports conversations and processes them according to the user's configuration.", + "canonical": true, + "file": "contact_center_insights.ingest_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "IngestConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversations", + "async": true, + "parameters": [ + { + "name": "gcs_source", + "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource" + }, + { + "name": "transcript_object_config", + "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversation_config", + "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "IngestConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversations", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async", + "title": "ContactCenterInsights exportInsightsData Sample", + "origin": "API_DEFINITION", + "description": " Export insights data to a destination defined in the request body.", + "canonical": true, + "file": "contact_center_insights.export_insights_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportInsightsData", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ExportInsightsData", + "async": true, + "parameters": [ + { + "name": "big_query_destination", + "type": ".google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.BigQueryDestination" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "kms_key", + "type": "TYPE_STRING" + }, + { + "name": "write_disposition", + "type": ".google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.WriteDisposition" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ExportInsightsData", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ExportInsightsData", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async", + "title": "ContactCenterInsights createIssueModel Sample", + "origin": "API_DEFINITION", + "description": " Creates an issue model.", + "canonical": true, + "file": "contact_center_insights.create_issue_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateIssueModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "issue_model", + "type": ".google.cloud.contactcenterinsights.v1.IssueModel" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CreateIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateIssueModel", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async", + "title": "ContactCenterInsights updateIssueModel Sample", + "origin": "API_DEFINITION", + "description": " Updates an issue model.", + "canonical": true, + "file": "contact_center_insights.update_issue_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssueModel", + "async": true, + "parameters": [ + { + "name": "issue_model", + "type": ".google.cloud.contactcenterinsights.v1.IssueModel" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.IssueModel", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UpdateIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssueModel", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async", + "title": "ContactCenterInsights getIssueModel Sample", + "origin": "API_DEFINITION", + "description": " Gets an issue model.", + "canonical": true, + "file": "contact_center_insights.get_issue_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssueModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.IssueModel", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssueModel", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async", + "title": "ContactCenterInsights listIssueModels Sample", + "origin": "API_DEFINITION", + "description": " Lists issue models.", + "canonical": true, + "file": "contact_center_insights.list_issue_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListIssueModels", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssueModels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.ListIssueModelsResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ListIssueModels", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssueModels", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async", + "title": "ContactCenterInsights deleteIssueModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes an issue model.", + "canonical": true, + "file": "contact_center_insights.delete_issue_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeleteIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueModel", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async", + "title": "ContactCenterInsights deployIssueModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys an issue model. Returns an error if a model is already deployed. An issue model can only be used in analysis after it has been deployed.", + "canonical": true, + "file": "contact_center_insights.deploy_issue_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeployIssueModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeployIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeployIssueModel", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async", + "title": "ContactCenterInsights undeployIssueModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys an issue model. An issue model can not be used in analysis after it has been undeployed.", + "canonical": true, + "file": "contact_center_insights.undeploy_issue_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UndeployIssueModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UndeployIssueModel", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UndeployIssueModel", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async", + "title": "ContactCenterInsights getIssue Sample", + "origin": "API_DEFINITION", + "description": " Gets an issue.", + "canonical": true, + "file": "contact_center_insights.get_issue.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssue", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Issue", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssue", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async", + "title": "ContactCenterInsights listIssues Sample", + "origin": "API_DEFINITION", + "description": " Lists issues.", + "canonical": true, + "file": "contact_center_insights.list_issues.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListIssues", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssues", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.ListIssuesResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ListIssues", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssues", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async", + "title": "ContactCenterInsights updateIssue Sample", + "origin": "API_DEFINITION", + "description": " Updates an issue.", + "canonical": true, + "file": "contact_center_insights.update_issue.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssue", + "async": true, + "parameters": [ + { + "name": "issue", + "type": ".google.cloud.contactcenterinsights.v1.Issue" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Issue", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UpdateIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssue", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async", + "title": "ContactCenterInsights deleteIssue Sample", + "origin": "API_DEFINITION", + "description": " Deletes an issue.", + "canonical": true, + "file": "contact_center_insights.delete_issue.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssue", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeleteIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssue", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async", + "title": "ContactCenterInsights calculateIssueModelStats Sample", + "origin": "API_DEFINITION", + "description": " Gets an issue model's statistics.", + "canonical": true, + "file": "contact_center_insights.calculate_issue_model_stats.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CalculateIssueModelStats", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateIssueModelStats", + "async": true, + "parameters": [ + { + "name": "issue_model", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CalculateIssueModelStats", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateIssueModelStats", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async", + "title": "ContactCenterInsights createPhraseMatcher Sample", + "origin": "API_DEFINITION", + "description": " Creates a phrase matcher.", + "canonical": true, + "file": "contact_center_insights.create_phrase_matcher.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreatePhraseMatcher", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "phrase_matcher", + "type": ".google.cloud.contactcenterinsights.v1.PhraseMatcher" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.PhraseMatcher", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CreatePhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreatePhraseMatcher", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async", + "title": "ContactCenterInsights getPhraseMatcher Sample", + "origin": "API_DEFINITION", + "description": " Gets a phrase matcher.", + "canonical": true, + "file": "contact_center_insights.get_phrase_matcher.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetPhraseMatcher", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.PhraseMatcher", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetPhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetPhraseMatcher", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async", + "title": "ContactCenterInsights listPhraseMatchers Sample", + "origin": "API_DEFINITION", + "description": " Lists phrase matchers.", + "canonical": true, + "file": "contact_center_insights.list_phrase_matchers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPhraseMatchers", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListPhraseMatchers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.ListPhraseMatchersResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ListPhraseMatchers", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListPhraseMatchers", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async", + "title": "ContactCenterInsights deletePhraseMatcher Sample", + "origin": "API_DEFINITION", + "description": " Deletes a phrase matcher.", + "canonical": true, + "file": "contact_center_insights.delete_phrase_matcher.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeletePhraseMatcher", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeletePhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeletePhraseMatcher", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async", + "title": "ContactCenterInsights updatePhraseMatcher Sample", + "origin": "API_DEFINITION", + "description": " Updates a phrase matcher.", + "canonical": true, + "file": "contact_center_insights.update_phrase_matcher.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdatePhraseMatcher", + "async": true, + "parameters": [ + { + "name": "phrase_matcher", + "type": ".google.cloud.contactcenterinsights.v1.PhraseMatcher" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.PhraseMatcher", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UpdatePhraseMatcher", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdatePhraseMatcher", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async", + "title": "ContactCenterInsights calculateStats Sample", + "origin": "API_DEFINITION", + "description": " Gets conversation statistics.", + "canonical": true, + "file": "contact_center_insights.calculate_stats.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CalculateStats", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateStats", + "async": true, + "parameters": [ + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.CalculateStatsResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CalculateStats", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateStats", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async", + "title": "ContactCenterInsights getSettings Sample", + "origin": "API_DEFINITION", + "description": " Gets project-level settings.", + "canonical": true, + "file": "contact_center_insights.get_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSettings", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Settings", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetSettings", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetSettings", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async", + "title": "ContactCenterInsights updateSettings Sample", + "origin": "API_DEFINITION", + "description": " Updates project-level settings.", + "canonical": true, + "file": "contact_center_insights.update_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSettings", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateSettings", + "async": true, + "parameters": [ + { + "name": "settings", + "type": ".google.cloud.contactcenterinsights.v1.Settings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.Settings", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UpdateSettings", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateSettings", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async", + "title": "ContactCenterInsights createView Sample", + "origin": "API_DEFINITION", + "description": " Creates a view.", + "canonical": true, + "file": "contact_center_insights.create_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateView", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.contactcenterinsights.v1.View" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.View", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "CreateView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateView", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async", + "title": "ContactCenterInsights getView Sample", + "origin": "API_DEFINITION", + "description": " Gets a view.", + "canonical": true, + "file": "contact_center_insights.get_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.View", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "GetView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetView", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async", + "title": "ContactCenterInsights listViews Sample", + "origin": "API_DEFINITION", + "description": " Lists views.", + "canonical": true, + "file": "contact_center_insights.list_views.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListViews", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListViews", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.ListViewsResponse", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "ListViews", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListViews", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async", + "title": "ContactCenterInsights updateView Sample", + "origin": "API_DEFINITION", + "description": " Updates a view.", + "canonical": true, + "file": "contact_center_insights.update_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateView", + "async": true, + "parameters": [ + { + "name": "view", + "type": ".google.cloud.contactcenterinsights.v1.View" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.contactcenterinsights.v1.View", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "UpdateView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateView", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async", + "title": "ContactCenterInsights deleteView Sample", + "origin": "API_DEFINITION", + "description": " Deletes a view.", + "canonical": true, + "file": "contact_center_insights.delete_view.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteView", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeleteView", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteView", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts new file mode 100644 index 00000000000..7b7df987f41 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const ContactCenterInsightsClient = v1.ContactCenterInsightsClient; +type ContactCenterInsightsClient = v1.ContactCenterInsightsClient; +export {v1, ContactCenterInsightsClient}; +export default {v1, ContactCenterInsightsClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts new file mode 100644 index 00000000000..83c5efe9951 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts @@ -0,0 +1,4370 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/contact_center_insights_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './contact_center_insights_client_config.json'; +const version = require('../../../package.json').version; + +/** + * An API that lets users analyze and explore their business conversation data. + * @class + * @memberof v1 + */ +export class ContactCenterInsightsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + contactCenterInsightsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ContactCenterInsightsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ContactCenterInsightsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ContactCenterInsightsClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + analysisPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}' + ), + conversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + issuePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}' + ), + issueModelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/issueModels/{issue_model}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + phraseMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}' + ), + settingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/settings' + ), + viewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/views/{view}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listConversations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'), + listAnalyses: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'analyses'), + listPhraseMatchers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseMatchers'), + listViews: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'views') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createAnalysisResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.Analysis') as gax.protobuf.Type; + const createAnalysisMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata') as gax.protobuf.Type; + const bulkAnalyzeConversationsResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse') as gax.protobuf.Type; + const bulkAnalyzeConversationsMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata') as gax.protobuf.Type; + const ingestConversationsResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.IngestConversationsResponse') as gax.protobuf.Type; + const ingestConversationsMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata') as gax.protobuf.Type; + const exportInsightsDataResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse') as gax.protobuf.Type; + const exportInsightsDataMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata') as gax.protobuf.Type; + const createIssueModelResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.IssueModel') as gax.protobuf.Type; + const createIssueModelMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata') as gax.protobuf.Type; + const deleteIssueModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteIssueModelMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata') as gax.protobuf.Type; + const deployIssueModelResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.DeployIssueModelResponse') as gax.protobuf.Type; + const deployIssueModelMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata') as gax.protobuf.Type; + const undeployIssueModelResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.UndeployIssueModelResponse') as gax.protobuf.Type; + const undeployIssueModelMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createAnalysis: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAnalysisResponse.decode.bind(createAnalysisResponse), + createAnalysisMetadata.decode.bind(createAnalysisMetadata)), + bulkAnalyzeConversations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + bulkAnalyzeConversationsResponse.decode.bind(bulkAnalyzeConversationsResponse), + bulkAnalyzeConversationsMetadata.decode.bind(bulkAnalyzeConversationsMetadata)), + ingestConversations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + ingestConversationsResponse.decode.bind(ingestConversationsResponse), + ingestConversationsMetadata.decode.bind(ingestConversationsMetadata)), + exportInsightsData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportInsightsDataResponse.decode.bind(exportInsightsDataResponse), + exportInsightsDataMetadata.decode.bind(exportInsightsDataMetadata)), + createIssueModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createIssueModelResponse.decode.bind(createIssueModelResponse), + createIssueModelMetadata.decode.bind(createIssueModelMetadata)), + deleteIssueModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteIssueModelResponse.decode.bind(deleteIssueModelResponse), + deleteIssueModelMetadata.decode.bind(deleteIssueModelMetadata)), + deployIssueModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployIssueModelResponse.decode.bind(deployIssueModelResponse), + deployIssueModelMetadata.decode.bind(deployIssueModelMetadata)), + undeployIssueModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployIssueModelResponse.decode.bind(undeployIssueModelResponse), + undeployIssueModelMetadata.decode.bind(undeployIssueModelMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.contactcenterinsights.v1.ContactCenterInsights', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.contactCenterInsightsStub) { + return this.contactCenterInsightsStub; + } + + // Put together the "service stub" for + // google.cloud.contactcenterinsights.v1.ContactCenterInsights. + this.contactCenterInsightsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.contactcenterinsights.v1.ContactCenterInsights') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.contactcenterinsights.v1.ContactCenterInsights, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const contactCenterInsightsStubMethods = + ['createConversation', 'updateConversation', 'getConversation', 'listConversations', 'deleteConversation', 'createAnalysis', 'getAnalysis', 'listAnalyses', 'deleteAnalysis', 'bulkAnalyzeConversations', 'ingestConversations', 'exportInsightsData', 'createIssueModel', 'updateIssueModel', 'getIssueModel', 'listIssueModels', 'deleteIssueModel', 'deployIssueModel', 'undeployIssueModel', 'getIssue', 'listIssues', 'updateIssue', 'deleteIssue', 'calculateIssueModelStats', 'createPhraseMatcher', 'getPhraseMatcher', 'listPhraseMatchers', 'deletePhraseMatcher', 'updatePhraseMatcher', 'calculateStats', 'getSettings', 'updateSettings', 'createView', 'getView', 'listViews', 'updateView', 'deleteView']; + for (const methodName of contactCenterInsightsStubMethods) { + const callPromise = this.contactCenterInsightsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.contactCenterInsightsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'contactcenterinsights.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'contactcenterinsights.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the conversation. + * @param {google.cloud.contactcenterinsights.v1.Conversation} request.conversation + * Required. The conversation resource to create. + * @param {string} request.conversationId + * A unique ID for the new conversation. This ID will become the final + * component of the conversation's resource name. If no ID is specified, a + * server-generated ID will be used. + * + * This value should be 4-64 characters and must match the regular + * expression `^{@link 0-9|a-z0-9-]{4,64}$`. Valid characters are `[a-z}-` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_conversation.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async + */ + createConversation( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|undefined, {}|undefined + ]>; + createConversation( + request: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, + {}|null|undefined>): void; + createConversation( + request: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, + {}|null|undefined>): void; + createConversation( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createConversation(request, options, callback); + } +/** + * Updates a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.Conversation} request.conversation + * Required. The new values for the conversation. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.update_conversation.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async + */ + updateConversation( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|undefined, {}|undefined + ]>; + updateConversation( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, + {}|null|undefined>): void; + updateConversation( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, + {}|null|undefined>): void; + updateConversation( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'conversation.name': request.conversation!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConversation(request, options, callback); + } +/** + * Gets a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation to get. + * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view + * The level of details of the conversation. Default is `FULL`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_conversation.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async + */ + getConversation( + request?: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|undefined, {}|undefined + ]>; + getConversation( + request: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>): void; + getConversation( + request: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>): void; + getConversation( + request?: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation, + protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getConversation(request, options, callback); + } +/** + * Deletes a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation to delete. + * @param {boolean} request.force + * If set to true, all of this conversation's analyses will also be deleted. + * Otherwise, the request will only succeed if the conversation has no + * analyses. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_conversation.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async + */ + deleteConversation( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|undefined, {}|undefined + ]>; + deleteConversation( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): void; + deleteConversation( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): void; + deleteConversation( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteConversation(request, options, callback); + } +/** + * Gets an analysis. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the analysis to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_analysis.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async + */ + getAnalysis( + request?: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IAnalysis, + protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|undefined, {}|undefined + ]>; + getAnalysis( + request: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IAnalysis, + protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, + {}|null|undefined>): void; + getAnalysis( + request: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IAnalysis, + protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, + {}|null|undefined>): void; + getAnalysis( + request?: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IAnalysis, + protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IAnalysis, + protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IAnalysis, + protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getAnalysis(request, options, callback); + } +/** + * Deletes an analysis. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the analysis to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_analysis.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async + */ + deleteAnalysis( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|undefined, {}|undefined + ]>; + deleteAnalysis( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, + {}|null|undefined>): void; + deleteAnalysis( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, + {}|null|undefined>): void; + deleteAnalysis( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteAnalysis(request, options, callback); + } +/** + * Updates an issue model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.IssueModel} request.issueModel + * Required. The new values for the issue model. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [IssueModel]{@link google.cloud.contactcenterinsights.v1.IssueModel}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.update_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async + */ + updateIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|undefined, {}|undefined + ]>; + updateIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, + {}|null|undefined>): void; + updateIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, + {}|null|undefined>): void; + updateIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'issue_model.name': request.issueModel!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateIssueModel(request, options, callback); + } +/** + * Gets an issue model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the issue model to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [IssueModel]{@link google.cloud.contactcenterinsights.v1.IssueModel}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async + */ + getIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|undefined, {}|undefined + ]>; + getIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, + {}|null|undefined>): void; + getIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, + {}|null|undefined>): void; + getIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssueModel, + protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIssueModel(request, options, callback); + } +/** + * Lists issue models. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the issue model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListIssueModelsResponse]{@link google.cloud.contactcenterinsights.v1.ListIssueModelsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.list_issue_models.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async + */ + listIssueModels( + request?: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|undefined, {}|undefined + ]>; + listIssueModels( + request: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, + {}|null|undefined>): void; + listIssueModels( + request: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, + {}|null|undefined>): void; + listIssueModels( + request?: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listIssueModels(request, options, callback); + } +/** + * Gets an issue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the issue to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Issue]{@link google.cloud.contactcenterinsights.v1.Issue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_issue.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async + */ + getIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|undefined, {}|undefined + ]>; + getIssue( + request: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, + {}|null|undefined>): void; + getIssue( + request: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, + {}|null|undefined>): void; + getIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIssue(request, options, callback); + } +/** + * Lists issues. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the issue. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListIssuesResponse]{@link google.cloud.contactcenterinsights.v1.ListIssuesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.list_issues.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async + */ + listIssues( + request?: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|undefined, {}|undefined + ]>; + listIssues( + request: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, + {}|null|undefined>): void; + listIssues( + request: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, + {}|null|undefined>): void; + listIssues( + request?: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, + protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listIssues(request, options, callback); + } +/** + * Updates an issue. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.Issue} request.issue + * Required. The new values for the issue. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Issue]{@link google.cloud.contactcenterinsights.v1.Issue}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.update_issue.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async + */ + updateIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|undefined, {}|undefined + ]>; + updateIssue( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, + {}|null|undefined>): void; + updateIssue( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, + {}|null|undefined>): void; + updateIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IIssue, + protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'issue.name': request.issue!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateIssue(request, options, callback); + } +/** + * Deletes an issue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the issue to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_issue.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async + */ + deleteIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|undefined, {}|undefined + ]>; + deleteIssue( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, + {}|null|undefined>): void; + deleteIssue( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, + {}|null|undefined>): void; + deleteIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteIssue(request, options, callback); + } +/** + * Gets an issue model's statistics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.issueModel + * Required. The resource name of the issue model to query against. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CalculateIssueModelStatsResponse]{@link google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async + */ + calculateIssueModelStats( + request?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|undefined, {}|undefined + ]>; + calculateIssueModelStats( + request: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, + {}|null|undefined>): void; + calculateIssueModelStats( + request: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, + {}|null|undefined>): void; + calculateIssueModelStats( + request?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'issue_model': request.issueModel ?? '', + }); + this.initialize(); + return this.innerApiCalls.calculateIssueModelStats(request, options, callback); + } +/** + * Creates a phrase matcher. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the phrase matcher. Required. The location to create + * a phrase matcher for. + * Format: `projects//locations/` or + * `projects//locations/` + * @param {google.cloud.contactcenterinsights.v1.PhraseMatcher} request.phraseMatcher + * Required. The phrase matcher resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_phrase_matcher.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async + */ + createPhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|undefined, {}|undefined + ]>; + createPhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + createPhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + createPhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createPhraseMatcher(request, options, callback); + } +/** + * Gets a phrase matcher. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase matcher to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_phrase_matcher.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async + */ + getPhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|undefined, {}|undefined + ]>; + getPhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + getPhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + getPhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getPhraseMatcher(request, options, callback); + } +/** + * Deletes a phrase matcher. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the phrase matcher to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_phrase_matcher.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async + */ + deletePhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|undefined, {}|undefined + ]>; + deletePhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + deletePhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deletePhraseMatcher(request, options, callback); + } +/** + * Updates a phrase matcher. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.PhraseMatcher} request.phraseMatcher + * Required. The new values for the phrase matcher. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.update_phrase_matcher.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async + */ + updatePhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|undefined, {}|undefined + ]>; + updatePhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseMatcher( + request: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, + {}|null|undefined>): void; + updatePhraseMatcher( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, + protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'phrase_matcher.name': request.phraseMatcher!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updatePhraseMatcher(request, options, callback); + } +/** + * Gets conversation statistics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The location of the conversations. + * @param {string} request.filter + * A filter to reduce results to a specific subset. This field is useful for + * getting statistics about conversations with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CalculateStatsResponse]{@link google.cloud.contactcenterinsights.v1.CalculateStatsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.calculate_stats.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async + */ + calculateStats( + request?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|undefined, {}|undefined + ]>; + calculateStats( + request: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, + {}|null|undefined>): void; + calculateStats( + request: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, + {}|null|undefined>): void; + calculateStats( + request?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, + protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'location': request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.calculateStats(request, options, callback); + } +/** + * Gets project-level settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the settings resource to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Settings]{@link google.cloud.contactcenterinsights.v1.Settings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_settings.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async + */ + getSettings( + request?: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|undefined, {}|undefined + ]>; + getSettings( + request: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, + {}|null|undefined>): void; + getSettings( + request: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, + {}|null|undefined>): void; + getSettings( + request?: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSettings(request, options, callback); + } +/** + * Updates project-level settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.Settings} request.settings + * Required. The new settings values. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Settings]{@link google.cloud.contactcenterinsights.v1.Settings}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.update_settings.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async + */ + updateSettings( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|undefined, {}|undefined + ]>; + updateSettings( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateSettings( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, + {}|null|undefined>): void; + updateSettings( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.ISettings, + protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'settings.name': request.settings!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSettings(request, options, callback); + } +/** + * Creates a view. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the view. Required. The location to create + * a view for. + * Format: `projects//locations/` or + * `projects//locations/` + * @param {google.cloud.contactcenterinsights.v1.View} request.view + * Required. The view resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [View]{@link google.cloud.contactcenterinsights.v1.View}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_view.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async + */ + createView( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|undefined, {}|undefined + ]>; + createView( + request: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, + {}|null|undefined>): void; + createView( + request: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, + {}|null|undefined>): void; + createView( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createView(request, options, callback); + } +/** + * Gets a view. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the view to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [View]{@link google.cloud.contactcenterinsights.v1.View}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.get_view.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async + */ + getView( + request?: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|undefined, {}|undefined + ]>; + getView( + request: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, + {}|null|undefined>): void; + getView( + request: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, + {}|null|undefined>): void; + getView( + request?: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getView(request, options, callback); + } +/** + * Updates a view. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.View} request.view + * Required. The new view. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [View]{@link google.cloud.contactcenterinsights.v1.View}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.update_view.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async + */ + updateView( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|undefined, {}|undefined + ]>; + updateView( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, + {}|null|undefined>): void; + updateView( + request: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, + callback: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, + {}|null|undefined>): void; + updateView( + request?: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView, + protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'view.name': request.view!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateView(request, options, callback); + } +/** + * Deletes a view. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the view to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_view.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async + */ + deleteView( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|undefined, {}|undefined + ]>; + deleteView( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, + {}|null|undefined>): void; + deleteView( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, + {}|null|undefined>): void; + deleteView( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteView(request, options, callback); + } + +/** + * Creates an analysis. The long running operation is done when the analysis + * has completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the analysis. + * @param {google.cloud.contactcenterinsights.v1.Analysis} request.analysis + * Required. The analysis to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_analysis.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async + */ + createAnalysis( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createAnalysis( + request: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createAnalysis( + request: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createAnalysis( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createAnalysis(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createAnalysis()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_analysis.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async + */ + async checkCreateAnalysisProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAnalysis, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Analyzes multiple conversations in a single request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource to create analyses in. + * @param {string} request.filter + * Required. Filter used to select the subset of conversations to analyze. + * @param {number} request.analysisPercentage + * Required. Percentage of selected conversation to analyze, between + * [0, 100]. + * @param {google.cloud.contactcenterinsights.v1.AnnotatorSelector} request.annotatorSelector + * To select the annotators to run and the phrase matchers to use + * (if any). If not specified, all annotators will be run. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async + */ + bulkAnalyzeConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + bulkAnalyzeConversations( + request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + bulkAnalyzeConversations( + request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + bulkAnalyzeConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.bulkAnalyzeConversations(request, options, callback); + } +/** + * Check the status of the long running operation returned by `bulkAnalyzeConversations()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async + */ + async checkBulkAnalyzeConversationsProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.bulkAnalyzeConversations, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports conversations and processes them according to the user's + * configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} request.gcsSource + * A cloud storage bucket source. + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} request.transcriptObjectConfig + * Configuration for when `source` contains conversation transcripts. + * @param {string} request.parent + * Required. The parent resource for new conversations. + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} request.conversationConfig + * Configuration that applies to all conversations. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.ingest_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async + */ + ingestConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + ingestConversations( + request: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + ingestConversations( + request: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + ingestConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.ingestConversations(request, options, callback); + } +/** + * Check the status of the long running operation returned by `ingestConversations()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.ingest_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async + */ + async checkIngestConversationsProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.ingestConversations, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Export insights data to a destination defined in the request body. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.BigQueryDestination} request.bigQueryDestination + * Specified if sink is a BigQuery table. + * @param {string} request.parent + * Required. The parent resource to export data from. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for exporting + * conversations with specific properties. + * @param {string} request.kmsKey + * A fully qualified KMS key name for BigQuery tables protected by CMEK. + * Format: + * projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version} + * @param {google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.WriteDisposition} request.writeDisposition + * Options for what to do if the destination table already exists. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.export_insights_data.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async + */ + exportInsightsData( + request?: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportInsightsData( + request: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportInsightsData( + request: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportInsightsData( + request?: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportInsightsData(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportInsightsData()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.export_insights_data.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async + */ + async checkExportInsightsDataProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportInsightsData, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an issue model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the issue model. + * @param {google.cloud.contactcenterinsights.v1.IssueModel} request.issueModel + * Required. The issue model to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async + */ + createIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createIssueModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createIssueModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.create_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async + */ + async checkCreateIssueModelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIssueModel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an issue model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the issue model to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async + */ + deleteIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteIssueModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteIssueModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async + */ + async checkDeleteIssueModelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIssueModel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys an issue model. Returns an error if a model is already deployed. + * An issue model can only be used in analysis after it has been deployed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The issue model to deploy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.deploy_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async + */ + deployIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deployIssueModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deployIssueModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.deploy_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async + */ + async checkDeployIssueModelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployIssueModel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys an issue model. + * An issue model can not be used in analysis after it has been undeployed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The issue model to undeploy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.undeploy_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async + */ + undeployIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployIssueModel( + request: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployIssueModel( + request?: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.undeployIssueModel(request, options, callback); + } +/** + * Check the status of the long running operation returned by `undeployIssueModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.undeploy_issue_model.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async + */ + async checkUndeployIssueModelProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployIssueModel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists conversations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the conversation. + * @param {number} request.pageSize + * The maximum number of conversations to return in the response. A valid page + * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * unspecified, a default page size of 100 will be chosen. Note that a call + * might return fewer results than the requested page size. + * @param {string} request.pageToken + * The value returned by the last `ListConversationsResponse`. This value + * indicates that this is a continuation of a prior `ListConversations` call + * and that the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view + * The level of details of the conversation. Default is `BASIC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation[], + protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse + ]>; + listConversations( + request: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IConversation>): void; + listConversations( + request: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IConversation>): void; + listConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IConversation>, + callback?: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IConversation>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IConversation[], + protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listConversations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the conversation. + * @param {number} request.pageSize + * The maximum number of conversations to return in the response. A valid page + * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * unspecified, a default page size of 100 will be chosen. Note that a call + * might return fewer results than the requested page size. + * @param {string} request.pageToken + * The value returned by the last `ListConversationsResponse`. This value + * indicates that this is a continuation of a prior `ListConversations` call + * and that the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view + * The level of details of the conversation. Default is `BASIC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConversationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationsStream( + request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConversations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversations.createStream( + this.innerApiCalls.listConversations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listConversations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the conversation. + * @param {number} request.pageSize + * The maximum number of conversations to return in the response. A valid page + * size ranges from 0 to 1,000 inclusive. If the page size is zero or + * unspecified, a default page size of 100 will be chosen. Note that a call + * might return fewer results than the requested page size. + * @param {string} request.pageToken + * The value returned by the last `ListConversationsResponse`. This value + * indicates that this is a continuation of a prior `ListConversations` call + * and that the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view + * The level of details of the conversation. Default is `BASIC`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.list_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async + */ + listConversationsAsync( + request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConversations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConversations.asyncIterate( + this.innerApiCalls['listConversations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists analyses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the analyses. + * @param {number} request.pageSize + * The maximum number of analyses to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListAnalysesResponse`; indicates + * that this is a continuation of a prior `ListAnalyses` call and + * the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnalysesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnalyses( + request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IAnalysis[], + protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse + ]>; + listAnalyses( + request: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IAnalysis>): void; + listAnalyses( + request: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IAnalysis>): void; + listAnalyses( + request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IAnalysis>, + callback?: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IAnalysis>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IAnalysis[], + protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAnalyses(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the analyses. + * @param {number} request.pageSize + * The maximum number of analyses to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListAnalysesResponse`; indicates + * that this is a continuation of a prior `ListAnalyses` call and + * the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnalysesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnalysesStream( + request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnalyses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnalyses.createStream( + this.innerApiCalls.listAnalyses as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAnalyses`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the analyses. + * @param {number} request.pageSize + * The maximum number of analyses to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListAnalysesResponse`; indicates + * that this is a continuation of a prior `ListAnalyses` call and + * the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * conversations with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.list_analyses.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async + */ + listAnalysesAsync( + request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAnalyses']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAnalyses.asyncIterate( + this.innerApiCalls['listAnalyses'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists phrase matchers. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the phrase matcher. + * @param {number} request.pageSize + * The maximum number of phrase matchers to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListPhraseMatchersResponse`. This value + * indicates that this is a continuation of a prior `ListPhraseMatchers` call + * and that the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * phrase matchers with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPhraseMatchersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPhraseMatchers( + request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[], + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse + ]>; + listPhraseMatchers( + request: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>): void; + listPhraseMatchers( + request: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>): void; + listPhraseMatchers( + request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>, + callback?: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[], + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listPhraseMatchers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the phrase matcher. + * @param {number} request.pageSize + * The maximum number of phrase matchers to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListPhraseMatchersResponse`. This value + * indicates that this is a continuation of a prior `ListPhraseMatchers` call + * and that the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * phrase matchers with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPhraseMatchersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listPhraseMatchersStream( + request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseMatchers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPhraseMatchers.createStream( + this.innerApiCalls.listPhraseMatchers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPhraseMatchers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the phrase matcher. + * @param {number} request.pageSize + * The maximum number of phrase matchers to return in the response. If this + * value is zero, the service will select a default size. A call might return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListPhraseMatchersResponse`. This value + * indicates that this is a continuation of a prior `ListPhraseMatchers` call + * and that the system should return the next page of data. + * @param {string} request.filter + * A filter to reduce results to a specific subset. Useful for querying + * phrase matchers with specific properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.list_phrase_matchers.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async + */ + listPhraseMatchersAsync( + request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPhraseMatchers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPhraseMatchers.asyncIterate( + this.innerApiCalls['listPhraseMatchers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists views. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the views. + * @param {number} request.pageSize + * The maximum number of views to return in the response. If this + * value is zero, the service will select a default size. A call may return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListViewsResponse`; indicates + * that this is a continuation of a prior `ListViews` call and + * the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [View]{@link google.cloud.contactcenterinsights.v1.View}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listViews( + request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView[], + protos.google.cloud.contactcenterinsights.v1.IListViewsRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListViewsResponse + ]>; + listViews( + request: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IView>): void; + listViews( + request: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + callback: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IView>): void; + listViews( + request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IView>, + callback?: PaginationCallback< + protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, + protos.google.cloud.contactcenterinsights.v1.IView>): + Promise<[ + protos.google.cloud.contactcenterinsights.v1.IView[], + protos.google.cloud.contactcenterinsights.v1.IListViewsRequest|null, + protos.google.cloud.contactcenterinsights.v1.IListViewsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listViews(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the views. + * @param {number} request.pageSize + * The maximum number of views to return in the response. If this + * value is zero, the service will select a default size. A call may return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListViewsResponse`; indicates + * that this is a continuation of a prior `ListViews` call and + * the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [View]{@link google.cloud.contactcenterinsights.v1.View} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listViewsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listViewsStream( + request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listViews.createStream( + this.innerApiCalls.listViews as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listViews`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the views. + * @param {number} request.pageSize + * The maximum number of views to return in the response. If this + * value is zero, the service will select a default size. A call may return + * fewer objects than requested. A non-empty `next_page_token` in the response + * indicates that more data is available. + * @param {string} request.pageToken + * The value returned by the last `ListViewsResponse`; indicates + * that this is a continuation of a prior `ListViews` call and + * the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [View]{@link google.cloud.contactcenterinsights.v1.View}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.list_views.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async + */ + listViewsAsync( + request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listViews']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listViews.asyncIterate( + this.innerApiCalls['listViews'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified analysis resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} analysis + * @returns {string} Resource name string. + */ + analysisPath(project:string,location:string,conversation:string,analysis:string) { + return this.pathTemplates.analysisPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + analysis: analysis, + }); + } + + /** + * Parse the project from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).project; + } + + /** + * Parse the location from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).location; + } + + /** + * Parse the conversation from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).conversation; + } + + /** + * Parse the analysis from Analysis resource. + * + * @param {string} analysisName + * A fully-qualified path representing Analysis resource. + * @returns {string} A string representing the analysis. + */ + matchAnalysisFromAnalysisName(analysisName: string) { + return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; + } + + /** + * Return a fully-qualified conversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + conversationPath(project:string,location:string,conversation:string) { + return this.pathTemplates.conversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).project; + } + + /** + * Parse the location from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).location; + } + + /** + * Parse the conversation from Conversation resource. + * + * @param {string} conversationName + * A fully-qualified path representing Conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromConversationName(conversationName: string) { + return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; + } + + /** + * Return a fully-qualified issue resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} issue_model + * @param {string} issue + * @returns {string} Resource name string. + */ + issuePath(project:string,location:string,issueModel:string,issue:string) { + return this.pathTemplates.issuePathTemplate.render({ + project: project, + location: location, + issue_model: issueModel, + issue: issue, + }); + } + + /** + * Parse the project from Issue resource. + * + * @param {string} issueName + * A fully-qualified path representing Issue resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIssueName(issueName: string) { + return this.pathTemplates.issuePathTemplate.match(issueName).project; + } + + /** + * Parse the location from Issue resource. + * + * @param {string} issueName + * A fully-qualified path representing Issue resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIssueName(issueName: string) { + return this.pathTemplates.issuePathTemplate.match(issueName).location; + } + + /** + * Parse the issue_model from Issue resource. + * + * @param {string} issueName + * A fully-qualified path representing Issue resource. + * @returns {string} A string representing the issue_model. + */ + matchIssueModelFromIssueName(issueName: string) { + return this.pathTemplates.issuePathTemplate.match(issueName).issue_model; + } + + /** + * Parse the issue from Issue resource. + * + * @param {string} issueName + * A fully-qualified path representing Issue resource. + * @returns {string} A string representing the issue. + */ + matchIssueFromIssueName(issueName: string) { + return this.pathTemplates.issuePathTemplate.match(issueName).issue; + } + + /** + * Return a fully-qualified issueModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} issue_model + * @returns {string} Resource name string. + */ + issueModelPath(project:string,location:string,issueModel:string) { + return this.pathTemplates.issueModelPathTemplate.render({ + project: project, + location: location, + issue_model: issueModel, + }); + } + + /** + * Parse the project from IssueModel resource. + * + * @param {string} issueModelName + * A fully-qualified path representing IssueModel resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIssueModelName(issueModelName: string) { + return this.pathTemplates.issueModelPathTemplate.match(issueModelName).project; + } + + /** + * Parse the location from IssueModel resource. + * + * @param {string} issueModelName + * A fully-qualified path representing IssueModel resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIssueModelName(issueModelName: string) { + return this.pathTemplates.issueModelPathTemplate.match(issueModelName).location; + } + + /** + * Parse the issue_model from IssueModel resource. + * + * @param {string} issueModelName + * A fully-qualified path representing IssueModel resource. + * @returns {string} A string representing the issue_model. + */ + matchIssueModelFromIssueModelName(issueModelName: string) { + return this.pathTemplates.issueModelPathTemplate.match(issueModelName).issue_model; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified phraseMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} phrase_matcher + * @returns {string} Resource name string. + */ + phraseMatcherPath(project:string,location:string,phraseMatcher:string) { + return this.pathTemplates.phraseMatcherPathTemplate.render({ + project: project, + location: location, + phrase_matcher: phraseMatcher, + }); + } + + /** + * Parse the project from PhraseMatcher resource. + * + * @param {string} phraseMatcherName + * A fully-qualified path representing PhraseMatcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPhraseMatcherName(phraseMatcherName: string) { + return this.pathTemplates.phraseMatcherPathTemplate.match(phraseMatcherName).project; + } + + /** + * Parse the location from PhraseMatcher resource. + * + * @param {string} phraseMatcherName + * A fully-qualified path representing PhraseMatcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPhraseMatcherName(phraseMatcherName: string) { + return this.pathTemplates.phraseMatcherPathTemplate.match(phraseMatcherName).location; + } + + /** + * Parse the phrase_matcher from PhraseMatcher resource. + * + * @param {string} phraseMatcherName + * A fully-qualified path representing PhraseMatcher resource. + * @returns {string} A string representing the phrase_matcher. + */ + matchPhraseMatcherFromPhraseMatcherName(phraseMatcherName: string) { + return this.pathTemplates.phraseMatcherPathTemplate.match(phraseMatcherName).phrase_matcher; + } + + /** + * Return a fully-qualified settings resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + settingsPath(project:string,location:string) { + return this.pathTemplates.settingsPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Settings resource. + * + * @param {string} settingsName + * A fully-qualified path representing Settings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSettingsName(settingsName: string) { + return this.pathTemplates.settingsPathTemplate.match(settingsName).project; + } + + /** + * Parse the location from Settings resource. + * + * @param {string} settingsName + * A fully-qualified path representing Settings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSettingsName(settingsName: string) { + return this.pathTemplates.settingsPathTemplate.match(settingsName).location; + } + + /** + * Return a fully-qualified view resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} view + * @returns {string} Resource name string. + */ + viewPath(project:string,location:string,view:string) { + return this.pathTemplates.viewPathTemplate.render({ + project: project, + location: location, + view: view, + }); + } + + /** + * Parse the project from View resource. + * + * @param {string} viewName + * A fully-qualified path representing View resource. + * @returns {string} A string representing the project. + */ + matchProjectFromViewName(viewName: string) { + return this.pathTemplates.viewPathTemplate.match(viewName).project; + } + + /** + * Parse the location from View resource. + * + * @param {string} viewName + * A fully-qualified path representing View resource. + * @returns {string} A string representing the location. + */ + matchLocationFromViewName(viewName: string) { + return this.pathTemplates.viewPathTemplate.match(viewName).location; + } + + /** + * Parse the view from View resource. + * + * @param {string} viewName + * A fully-qualified path representing View resource. + * @returns {string} A string representing the view. + */ + matchViewFromViewName(viewName: string) { + return this.pathTemplates.viewPathTemplate.match(viewName).view; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.contactCenterInsightsStub && !this._terminated) { + return this.contactCenterInsightsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json new file mode 100644 index 00000000000..081f19a1212 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json @@ -0,0 +1,223 @@ +{ + "interfaces": { + "google.cloud.contactcenterinsights.v1.ContactCenterInsights": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListAnalyses": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteAnalysis": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "BulkAnalyzeConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "IngestConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ExportInsightsData": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListIssueModels": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeployIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UndeployIssueModel": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetIssue": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListIssues": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateIssue": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteIssue": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CalculateIssueModelStats": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreatePhraseMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetPhraseMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPhraseMatchers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeletePhraseMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdatePhraseMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CalculateStats": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSettings": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateView": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetView": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListViews": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateView": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteView": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json new file mode 100644 index 00000000000..a3a2efbf679 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto", + "../../protos/google/cloud/contactcenterinsights/v1/resources.proto" +] diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..de8d31be6c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json @@ -0,0 +1,409 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.contactcenterinsights.v1", + "libraryPackage": "@google-cloud/contact-center-insights", + "services": { + "ContactCenterInsights": { + "clients": { + "grpc": { + "libraryClient": "ContactCenterInsightsClient", + "rpcs": { + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "UpdateConversation": { + "methods": [ + "updateConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "GetAnalysis": { + "methods": [ + "getAnalysis" + ] + }, + "DeleteAnalysis": { + "methods": [ + "deleteAnalysis" + ] + }, + "UpdateIssueModel": { + "methods": [ + "updateIssueModel" + ] + }, + "GetIssueModel": { + "methods": [ + "getIssueModel" + ] + }, + "ListIssueModels": { + "methods": [ + "listIssueModels" + ] + }, + "GetIssue": { + "methods": [ + "getIssue" + ] + }, + "ListIssues": { + "methods": [ + "listIssues" + ] + }, + "UpdateIssue": { + "methods": [ + "updateIssue" + ] + }, + "DeleteIssue": { + "methods": [ + "deleteIssue" + ] + }, + "CalculateIssueModelStats": { + "methods": [ + "calculateIssueModelStats" + ] + }, + "CreatePhraseMatcher": { + "methods": [ + "createPhraseMatcher" + ] + }, + "GetPhraseMatcher": { + "methods": [ + "getPhraseMatcher" + ] + }, + "DeletePhraseMatcher": { + "methods": [ + "deletePhraseMatcher" + ] + }, + "UpdatePhraseMatcher": { + "methods": [ + "updatePhraseMatcher" + ] + }, + "CalculateStats": { + "methods": [ + "calculateStats" + ] + }, + "GetSettings": { + "methods": [ + "getSettings" + ] + }, + "UpdateSettings": { + "methods": [ + "updateSettings" + ] + }, + "CreateView": { + "methods": [ + "createView" + ] + }, + "GetView": { + "methods": [ + "getView" + ] + }, + "UpdateView": { + "methods": [ + "updateView" + ] + }, + "DeleteView": { + "methods": [ + "deleteView" + ] + }, + "CreateAnalysis": { + "methods": [ + "createAnalysis" + ] + }, + "BulkAnalyzeConversations": { + "methods": [ + "bulkAnalyzeConversations" + ] + }, + "IngestConversations": { + "methods": [ + "ingestConversations" + ] + }, + "ExportInsightsData": { + "methods": [ + "exportInsightsData" + ] + }, + "CreateIssueModel": { + "methods": [ + "createIssueModel" + ] + }, + "DeleteIssueModel": { + "methods": [ + "deleteIssueModel" + ] + }, + "DeployIssueModel": { + "methods": [ + "deployIssueModel" + ] + }, + "UndeployIssueModel": { + "methods": [ + "undeployIssueModel" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListAnalyses": { + "methods": [ + "listAnalyses", + "listAnalysesStream", + "listAnalysesAsync" + ] + }, + "ListPhraseMatchers": { + "methods": [ + "listPhraseMatchers", + "listPhraseMatchersStream", + "listPhraseMatchersAsync" + ] + }, + "ListViews": { + "methods": [ + "listViews", + "listViewsStream", + "listViewsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ContactCenterInsightsClient", + "rpcs": { + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "UpdateConversation": { + "methods": [ + "updateConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "DeleteConversation": { + "methods": [ + "deleteConversation" + ] + }, + "GetAnalysis": { + "methods": [ + "getAnalysis" + ] + }, + "DeleteAnalysis": { + "methods": [ + "deleteAnalysis" + ] + }, + "UpdateIssueModel": { + "methods": [ + "updateIssueModel" + ] + }, + "GetIssueModel": { + "methods": [ + "getIssueModel" + ] + }, + "ListIssueModels": { + "methods": [ + "listIssueModels" + ] + }, + "GetIssue": { + "methods": [ + "getIssue" + ] + }, + "ListIssues": { + "methods": [ + "listIssues" + ] + }, + "UpdateIssue": { + "methods": [ + "updateIssue" + ] + }, + "DeleteIssue": { + "methods": [ + "deleteIssue" + ] + }, + "CalculateIssueModelStats": { + "methods": [ + "calculateIssueModelStats" + ] + }, + "CreatePhraseMatcher": { + "methods": [ + "createPhraseMatcher" + ] + }, + "GetPhraseMatcher": { + "methods": [ + "getPhraseMatcher" + ] + }, + "DeletePhraseMatcher": { + "methods": [ + "deletePhraseMatcher" + ] + }, + "UpdatePhraseMatcher": { + "methods": [ + "updatePhraseMatcher" + ] + }, + "CalculateStats": { + "methods": [ + "calculateStats" + ] + }, + "GetSettings": { + "methods": [ + "getSettings" + ] + }, + "UpdateSettings": { + "methods": [ + "updateSettings" + ] + }, + "CreateView": { + "methods": [ + "createView" + ] + }, + "GetView": { + "methods": [ + "getView" + ] + }, + "UpdateView": { + "methods": [ + "updateView" + ] + }, + "DeleteView": { + "methods": [ + "deleteView" + ] + }, + "CreateAnalysis": { + "methods": [ + "createAnalysis" + ] + }, + "BulkAnalyzeConversations": { + "methods": [ + "bulkAnalyzeConversations" + ] + }, + "IngestConversations": { + "methods": [ + "ingestConversations" + ] + }, + "ExportInsightsData": { + "methods": [ + "exportInsightsData" + ] + }, + "CreateIssueModel": { + "methods": [ + "createIssueModel" + ] + }, + "DeleteIssueModel": { + "methods": [ + "deleteIssueModel" + ] + }, + "DeployIssueModel": { + "methods": [ + "deployIssueModel" + ] + }, + "UndeployIssueModel": { + "methods": [ + "undeployIssueModel" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListAnalyses": { + "methods": [ + "listAnalyses", + "listAnalysesStream", + "listAnalysesAsync" + ] + }, + "ListPhraseMatchers": { + "methods": [ + "listPhraseMatchers", + "listPhraseMatchersStream", + "listPhraseMatchersAsync" + ] + }, + "ListViews": { + "methods": [ + "listViews", + "listViewsStream", + "listViewsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts new file mode 100644 index 00000000000..e558952e41d --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ContactCenterInsightsClient} from './contact_center_insights_client'; diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..4720f20bc0d --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const contactcenterinsights = require('@google-cloud/contact-center-insights'); + +function main() { + const contactCenterInsightsClient = new contactcenterinsights.ContactCenterInsightsClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..8d2c0bf0ac7 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ContactCenterInsightsClient} from '@google-cloud/contact-center-insights'; + +// check that the client class type name can be used +function doStuffWithContactCenterInsightsClient(client: ContactCenterInsightsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const contactCenterInsightsClient = new ContactCenterInsightsClient(); + doStuffWithContactCenterInsightsClient(contactCenterInsightsClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts new file mode 100644 index 00000000000..557a57558e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts new file mode 100644 index 00000000000..c4ae59056ad --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts @@ -0,0 +1,5775 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as contactcenterinsightsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ContactCenterInsightsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = contactcenterinsightsModule.v1.ContactCenterInsightsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = contactcenterinsightsModule.v1.ContactCenterInsightsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = contactcenterinsightsModule.v1.ContactCenterInsightsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.contactCenterInsightsStub, undefined); + await client.initialize(); + assert(client.contactCenterInsightsStub); + }); + + it('has close method for the initialized client', done => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.contactCenterInsightsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.contactCenterInsightsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createConversation', () => { + it('invokes createConversation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Conversation() + ); + client.innerApiCalls.createConversation = stubSimpleCall(expectedResponse); + const [response] = await client.createConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Conversation() + ); + client.innerApiCalls.createConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConversation( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.createConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConversation with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createConversation(request), expectedError); + }); + }); + + describe('updateConversation', () => { + it('invokes updateConversation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() + ); + request.conversation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); + request.conversation.name = defaultValue1; + const expectedHeaderRequestParams = `conversation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Conversation() + ); + client.innerApiCalls.updateConversation = stubSimpleCall(expectedResponse); + const [response] = await client.updateConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() + ); + request.conversation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); + request.conversation.name = defaultValue1; + const expectedHeaderRequestParams = `conversation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Conversation() + ); + client.innerApiCalls.updateConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConversation( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() + ); + request.conversation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); + request.conversation.name = defaultValue1; + const expectedHeaderRequestParams = `conversation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConversation with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() + ); + request.conversation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); + request.conversation.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateConversation(request), expectedError); + }); + }); + + describe('getConversation', () => { + it('invokes getConversation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); + const [response] = await client.getConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConversation( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConversation with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConversation(request), expectedError); + }); + }); + + describe('deleteConversation', () => { + it('invokes deleteConversation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteConversation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConversation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteConversation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConversation with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteConversation(request), expectedError); + }); + }); + + describe('getAnalysis', () => { + it('invokes getAnalysis without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Analysis() + ); + client.innerApiCalls.getAnalysis = stubSimpleCall(expectedResponse); + const [response] = await client.getAnalysis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnalysis without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Analysis() + ); + client.innerApiCalls.getAnalysis = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnalysis( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IAnalysis|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnalysis with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnalysis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAnalysis(request), expectedError); + const actualRequest = (client.innerApiCalls.getAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnalysis with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnalysis(request), expectedError); + }); + }); + + describe('deleteAnalysis', () => { + it('invokes deleteAnalysis without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAnalysis = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAnalysis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnalysis without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAnalysis = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAnalysis( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnalysis with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAnalysis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAnalysis(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAnalysis with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAnalysis(request), expectedError); + }); + }); + + describe('updateIssueModel', () => { + it('invokes updateIssueModel without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() + ); + request.issueModel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); + request.issueModel.name = defaultValue1; + const expectedHeaderRequestParams = `issue_model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IssueModel() + ); + client.innerApiCalls.updateIssueModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateIssueModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIssueModel without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() + ); + request.issueModel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); + request.issueModel.name = defaultValue1; + const expectedHeaderRequestParams = `issue_model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IssueModel() + ); + client.innerApiCalls.updateIssueModel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIssueModel( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssueModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIssueModel with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() + ); + request.issueModel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); + request.issueModel.name = defaultValue1; + const expectedHeaderRequestParams = `issue_model.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIssueModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateIssueModel(request), expectedError); + const actualRequest = (client.innerApiCalls.updateIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIssueModel with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() + ); + request.issueModel ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); + request.issueModel.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateIssueModel(request), expectedError); + }); + }); + + describe('getIssueModel', () => { + it('invokes getIssueModel without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IssueModel() + ); + client.innerApiCalls.getIssueModel = stubSimpleCall(expectedResponse); + const [response] = await client.getIssueModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIssueModel without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IssueModel() + ); + client.innerApiCalls.getIssueModel = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIssueModel( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssueModel|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIssueModel with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIssueModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIssueModel(request), expectedError); + const actualRequest = (client.innerApiCalls.getIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIssueModel with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIssueModel(request), expectedError); + }); + }); + + describe('listIssueModels', () => { + it('invokes listIssueModels without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsResponse() + ); + client.innerApiCalls.listIssueModels = stubSimpleCall(expectedResponse); + const [response] = await client.listIssueModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listIssueModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIssueModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIssueModels without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsResponse() + ); + client.innerApiCalls.listIssueModels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIssueModels( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listIssueModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIssueModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIssueModels with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIssueModels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIssueModels(request), expectedError); + const actualRequest = (client.innerApiCalls.listIssueModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIssueModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIssueModels with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listIssueModels(request), expectedError); + }); + }); + + describe('getIssue', () => { + it('invokes getIssue without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Issue() + ); + client.innerApiCalls.getIssue = stubSimpleCall(expectedResponse); + const [response] = await client.getIssue(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIssue without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Issue() + ); + client.innerApiCalls.getIssue = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIssue( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssue|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIssue with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIssue = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIssue(request), expectedError); + const actualRequest = (client.innerApiCalls.getIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getIssue with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIssue(request), expectedError); + }); + }); + + describe('listIssues', () => { + it('invokes listIssues without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssuesResponse() + ); + client.innerApiCalls.listIssues = stubSimpleCall(expectedResponse); + const [response] = await client.listIssues(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listIssues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIssues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIssues without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssuesResponse() + ); + client.innerApiCalls.listIssues = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listIssues( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listIssues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIssues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIssues with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIssues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIssues(request), expectedError); + const actualRequest = (client.innerApiCalls.listIssues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIssues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listIssues with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listIssues(request), expectedError); + }); + }); + + describe('updateIssue', () => { + it('invokes updateIssue without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() + ); + request.issue ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); + request.issue.name = defaultValue1; + const expectedHeaderRequestParams = `issue.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Issue() + ); + client.innerApiCalls.updateIssue = stubSimpleCall(expectedResponse); + const [response] = await client.updateIssue(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIssue without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() + ); + request.issue ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); + request.issue.name = defaultValue1; + const expectedHeaderRequestParams = `issue.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Issue() + ); + client.innerApiCalls.updateIssue = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateIssue( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssue|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIssue with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() + ); + request.issue ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); + request.issue.name = defaultValue1; + const expectedHeaderRequestParams = `issue.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIssue = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateIssue(request), expectedError); + const actualRequest = (client.innerApiCalls.updateIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateIssue with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() + ); + request.issue ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); + request.issue.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateIssue(request), expectedError); + }); + }); + + describe('deleteIssue', () => { + it('invokes deleteIssue without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteIssue = stubSimpleCall(expectedResponse); + const [response] = await client.deleteIssue(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssue without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteIssue = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIssue( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssue with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIssue = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteIssue(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteIssue as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssue as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssue with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteIssue(request), expectedError); + }); + }); + + describe('calculateIssueModelStats', () => { + it('invokes calculateIssueModelStats without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); + request.issueModel = defaultValue1; + const expectedHeaderRequestParams = `issue_model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse() + ); + client.innerApiCalls.calculateIssueModelStats = stubSimpleCall(expectedResponse); + const [response] = await client.calculateIssueModelStats(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.calculateIssueModelStats as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.calculateIssueModelStats as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateIssueModelStats without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); + request.issueModel = defaultValue1; + const expectedHeaderRequestParams = `issue_model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse() + ); + client.innerApiCalls.calculateIssueModelStats = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.calculateIssueModelStats( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.calculateIssueModelStats as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.calculateIssueModelStats as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateIssueModelStats with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); + request.issueModel = defaultValue1; + const expectedHeaderRequestParams = `issue_model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.calculateIssueModelStats = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.calculateIssueModelStats(request), expectedError); + const actualRequest = (client.innerApiCalls.calculateIssueModelStats as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.calculateIssueModelStats as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateIssueModelStats with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); + request.issueModel = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.calculateIssueModelStats(request), expectedError); + }); + }); + + describe('createPhraseMatcher', () => { + it('invokes createPhraseMatcher without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() + ); + client.innerApiCalls.createPhraseMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.createPhraseMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseMatcher without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() + ); + client.innerApiCalls.createPhraseMatcher = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPhraseMatcher( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createPhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseMatcher with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPhraseMatcher = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPhraseMatcher(request), expectedError); + const actualRequest = (client.innerApiCalls.createPhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPhraseMatcher with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createPhraseMatcher(request), expectedError); + }); + }); + + describe('getPhraseMatcher', () => { + it('invokes getPhraseMatcher without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() + ); + client.innerApiCalls.getPhraseMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.getPhraseMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseMatcher without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() + ); + client.innerApiCalls.getPhraseMatcher = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPhraseMatcher( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getPhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseMatcher with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPhraseMatcher = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPhraseMatcher(request), expectedError); + const actualRequest = (client.innerApiCalls.getPhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPhraseMatcher with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPhraseMatcher(request), expectedError); + }); + }); + + describe('deletePhraseMatcher', () => { + it('invokes deletePhraseMatcher without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.deletePhraseMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseMatcher without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePhraseMatcher = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePhraseMatcher( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deletePhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseMatcher with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePhraseMatcher = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deletePhraseMatcher(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePhraseMatcher with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deletePhraseMatcher(request), expectedError); + }); + }); + + describe('updatePhraseMatcher', () => { + it('invokes updatePhraseMatcher without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() + ); + request.phraseMatcher ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); + request.phraseMatcher.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_matcher.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() + ); + client.innerApiCalls.updatePhraseMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.updatePhraseMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseMatcher without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() + ); + request.phraseMatcher ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); + request.phraseMatcher.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_matcher.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() + ); + client.innerApiCalls.updatePhraseMatcher = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePhraseMatcher( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updatePhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseMatcher with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() + ); + request.phraseMatcher ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); + request.phraseMatcher.name = defaultValue1; + const expectedHeaderRequestParams = `phrase_matcher.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePhraseMatcher = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updatePhraseMatcher(request), expectedError); + const actualRequest = (client.innerApiCalls.updatePhraseMatcher as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseMatcher as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePhraseMatcher with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() + ); + request.phraseMatcher ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); + request.phraseMatcher.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updatePhraseMatcher(request), expectedError); + }); + }); + + describe('calculateStats', () => { + it('invokes calculateStats without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateStatsResponse() + ); + client.innerApiCalls.calculateStats = stubSimpleCall(expectedResponse); + const [response] = await client.calculateStats(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.calculateStats as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.calculateStats as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateStats without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateStatsResponse() + ); + client.innerApiCalls.calculateStats = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.calculateStats( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.calculateStats as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.calculateStats as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateStats with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.calculateStats = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.calculateStats(request), expectedError); + const actualRequest = (client.innerApiCalls.calculateStats as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.calculateStats as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes calculateStats with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); + request.location = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.calculateStats(request), expectedError); + }); + }); + + describe('getSettings', () => { + it('invokes getSettings without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Settings() + ); + client.innerApiCalls.getSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSettings without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Settings() + ); + client.innerApiCalls.getSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSettings( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ISettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSettings with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSettings with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSettings(request), expectedError); + }); + }); + + describe('updateSettings', () => { + it('invokes updateSettings without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() + ); + request.settings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); + request.settings.name = defaultValue1; + const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Settings() + ); + client.innerApiCalls.updateSettings = stubSimpleCall(expectedResponse); + const [response] = await client.updateSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() + ); + request.settings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); + request.settings.name = defaultValue1; + const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.Settings() + ); + client.innerApiCalls.updateSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSettings( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ISettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() + ); + request.settings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); + request.settings.name = defaultValue1; + const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSettings with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() + ); + request.settings ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); + request.settings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSettings(request), expectedError); + }); + }); + + describe('createView', () => { + it('invokes createView without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.View() + ); + client.innerApiCalls.createView = stubSimpleCall(expectedResponse); + const [response] = await client.createView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createView without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.View() + ); + client.innerApiCalls.createView = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createView( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createView with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createView = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createView(request), expectedError); + const actualRequest = (client.innerApiCalls.createView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createView with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createView(request), expectedError); + }); + }); + + describe('getView', () => { + it('invokes getView without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.View() + ); + client.innerApiCalls.getView = stubSimpleCall(expectedResponse); + const [response] = await client.getView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getView without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.View() + ); + client.innerApiCalls.getView = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getView( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getView with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getView = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getView(request), expectedError); + const actualRequest = (client.innerApiCalls.getView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getView with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getView(request), expectedError); + }); + }); + + describe('updateView', () => { + it('invokes updateView without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() + ); + request.view ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); + request.view.name = defaultValue1; + const expectedHeaderRequestParams = `view.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.View() + ); + client.innerApiCalls.updateView = stubSimpleCall(expectedResponse); + const [response] = await client.updateView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateView without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() + ); + request.view ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); + request.view.name = defaultValue1; + const expectedHeaderRequestParams = `view.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.View() + ); + client.innerApiCalls.updateView = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateView( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateView with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() + ); + request.view ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); + request.view.name = defaultValue1; + const expectedHeaderRequestParams = `view.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateView = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateView(request), expectedError); + const actualRequest = (client.innerApiCalls.updateView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateView with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() + ); + request.view ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); + request.view.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateView(request), expectedError); + }); + }); + + describe('deleteView', () => { + it('invokes deleteView without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteView = stubSimpleCall(expectedResponse); + const [response] = await client.deleteView(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteView without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteView = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteView( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteView with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteView = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteView(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteView as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteView as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteView with closed client', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteView(request), expectedError); + }); + }); + + describe('createAnalysis', () => { + it('invokes createAnalysis without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAnalysis = stubLongRunningCall(expectedResponse); + const [operation] = await client.createAnalysis(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnalysis without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAnalysis = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAnalysis( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnalysis with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnalysis = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createAnalysis(request), expectedError); + const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAnalysis with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAnalysis = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createAnalysis(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAnalysisProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAnalysisProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAnalysisProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateAnalysisProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('bulkAnalyzeConversations', () => { + it('invokes bulkAnalyzeConversations without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall(expectedResponse); + const [operation] = await client.bulkAnalyzeConversations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkAnalyzeConversations without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkAnalyzeConversations( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkAnalyzeConversations with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.bulkAnalyzeConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkAnalyzeConversations with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.bulkAnalyzeConversations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBulkAnalyzeConversationsProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkBulkAnalyzeConversationsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBulkAnalyzeConversationsProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkBulkAnalyzeConversationsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('ingestConversations', () => { + it('invokes ingestConversations without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.ingestConversations = stubLongRunningCall(expectedResponse); + const [operation] = await client.ingestConversations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes ingestConversations without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.ingestConversations = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.ingestConversations( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes ingestConversations with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.ingestConversations = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.ingestConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes ingestConversations with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.ingestConversations = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.ingestConversations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkIngestConversationsProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkIngestConversationsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkIngestConversationsProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkIngestConversationsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('exportInsightsData', () => { + it('invokes exportInsightsData without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportInsightsData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportInsightsData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportInsightsData without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportInsightsData = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportInsightsData( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportInsightsData with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportInsightsData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportInsightsData(request), expectedError); + const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportInsightsData with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportInsightsData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportInsightsData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportInsightsDataProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportInsightsDataProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportInsightsDataProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportInsightsDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createIssueModel', () => { + it('invokes createIssueModel without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createIssueModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.createIssueModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIssueModel without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createIssueModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createIssueModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIssueModel with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIssueModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIssueModel(request), expectedError); + const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createIssueModel with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIssueModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIssueModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateIssueModelProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateIssueModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateIssueModelProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateIssueModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteIssueModel', () => { + it('invokes deleteIssueModel without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteIssueModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteIssueModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssueModel without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteIssueModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIssueModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssueModel with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIssueModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIssueModel(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssueModel with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIssueModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIssueModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteIssueModelProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteIssueModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteIssueModelProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteIssueModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployIssueModel', () => { + it('invokes deployIssueModel without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployIssueModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployIssueModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployIssueModel without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployIssueModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployIssueModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployIssueModel with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIssueModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployIssueModel(request), expectedError); + const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployIssueModel with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIssueModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployIssueModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployIssueModelProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeployIssueModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployIssueModelProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeployIssueModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployIssueModel', () => { + it('invokes undeployIssueModel without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployIssueModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployIssueModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployIssueModel without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployIssueModel = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployIssueModel( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployIssueModel with call error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIssueModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployIssueModel(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployIssueModel with LRO error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIssueModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployIssueModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployIssueModelProgress without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUndeployIssueModelProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployIssueModelProgress with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUndeployIssueModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listConversations', () => { + it('invokes listConversations without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + ]; + client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); + const [response] = await client.listConversations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversations without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + ]; + client.innerApiCalls.listConversations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConversations( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversations with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listConversations(request), expectedError); + const actualRequest = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConversationsStream without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + ]; + client.descriptors.page.listConversations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.Conversation[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Conversation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConversationsStream with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.Conversation[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Conversation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversations without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), + ]; + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contactcenterinsights.v1.IConversation[] = []; + const iterable = client.listConversationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConversations with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConversationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contactcenterinsights.v1.IConversation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listConversations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAnalyses', () => { + it('invokes listAnalyses without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + ]; + client.innerApiCalls.listAnalyses = stubSimpleCall(expectedResponse); + const [response] = await client.listAnalyses(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAnalyses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnalyses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnalyses without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + ]; + client.innerApiCalls.listAnalyses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAnalyses( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IAnalysis[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAnalyses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnalyses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnalyses with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnalyses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAnalyses(request), expectedError); + const actualRequest = (client.innerApiCalls.listAnalyses as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnalyses as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAnalysesStream without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + ]; + client.descriptors.page.listAnalyses.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAnalysesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.Analysis[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Analysis) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnalyses, request)); + assert( + (client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAnalysesStream with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnalyses.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAnalysesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.Analysis[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Analysis) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAnalyses, request)); + assert( + (client.descriptors.page.listAnalyses.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnalyses without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), + ]; + client.descriptors.page.listAnalyses.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contactcenterinsights.v1.IAnalysis[] = []; + const iterable = client.listAnalysesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAnalyses with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAnalyses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAnalysesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contactcenterinsights.v1.IAnalysis[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listPhraseMatchers', () => { + it('invokes listPhraseMatchers without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + ]; + client.innerApiCalls.listPhraseMatchers = stubSimpleCall(expectedResponse); + const [response] = await client.listPhraseMatchers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseMatchers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseMatchers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseMatchers without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + ]; + client.innerApiCalls.listPhraseMatchers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPhraseMatchers( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPhraseMatchers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseMatchers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseMatchers with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPhraseMatchers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPhraseMatchers(request), expectedError); + const actualRequest = (client.innerApiCalls.listPhraseMatchers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPhraseMatchers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPhraseMatchersStream without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + ]; + client.descriptors.page.listPhraseMatchers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listPhraseMatchersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPhraseMatchers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseMatchers, request)); + assert( + (client.descriptors.page.listPhraseMatchers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPhraseMatchersStream with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseMatchers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listPhraseMatchersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPhraseMatchers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPhraseMatchers, request)); + assert( + (client.descriptors.page.listPhraseMatchers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseMatchers without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), + ]; + client.descriptors.page.listPhraseMatchers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[] = []; + const iterable = client.listPhraseMatchersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPhraseMatchers with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPhraseMatchers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPhraseMatchersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listViews', () => { + it('invokes listViews without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + ]; + client.innerApiCalls.listViews = stubSimpleCall(expectedResponse); + const [response] = await client.listViews(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listViews as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listViews as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listViews without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + ]; + client.innerApiCalls.listViews = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listViews( + request, + (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listViews as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listViews as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listViews with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listViews = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listViews(request), expectedError); + const actualRequest = (client.innerApiCalls.listViews as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listViews as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listViewsStream without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + ]; + client.descriptors.page.listViews.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.View[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.View) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listViews, request)); + assert( + (client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listViewsStream with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listViews.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listViewsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.contactcenterinsights.v1.View[] = []; + stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.View) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listViews, request)); + assert( + (client.descriptors.page.listViews.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listViews without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), + ]; + client.descriptors.page.listViews.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.contactcenterinsights.v1.IView[] = []; + const iterable = client.listViewsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listViews.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listViews.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listViews with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listViews.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listViewsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.contactcenterinsights.v1.IView[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listViews.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listViews.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('analysis', () => { + const fakePath = "/rendered/path/analysis"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + conversation: "conversationValue", + analysis: "analysisValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.analysisPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.analysisPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('analysisPath', () => { + const result = client.analysisPath("projectValue", "locationValue", "conversationValue", "analysisValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.analysisPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAnalysisName', () => { + const result = client.matchProjectFromAnalysisName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAnalysisName', () => { + const result = client.matchLocationFromAnalysisName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromAnalysisName', () => { + const result = client.matchConversationFromAnalysisName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAnalysisFromAnalysisName', () => { + const result = client.matchAnalysisFromAnalysisName(fakePath); + assert.strictEqual(result, "analysisValue"); + assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('conversation', () => { + const fakePath = "/rendered/path/conversation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + conversation: "conversationValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.conversationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.conversationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('conversationPath', () => { + const result = client.conversationPath("projectValue", "locationValue", "conversationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromConversationName', () => { + const result = client.matchProjectFromConversationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromConversationName', () => { + const result = client.matchLocationFromConversationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchConversationFromConversationName', () => { + const result = client.matchConversationFromConversationName(fakePath); + assert.strictEqual(result, "conversationValue"); + assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('issue', () => { + const fakePath = "/rendered/path/issue"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + issue_model: "issueModelValue", + issue: "issueValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.issuePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.issuePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('issuePath', () => { + const result = client.issuePath("projectValue", "locationValue", "issueModelValue", "issueValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.issuePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIssueName', () => { + const result = client.matchProjectFromIssueName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.issuePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIssueName', () => { + const result = client.matchLocationFromIssueName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.issuePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIssueModelFromIssueName', () => { + const result = client.matchIssueModelFromIssueName(fakePath); + assert.strictEqual(result, "issueModelValue"); + assert((client.pathTemplates.issuePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIssueFromIssueName', () => { + const result = client.matchIssueFromIssueName(fakePath); + assert.strictEqual(result, "issueValue"); + assert((client.pathTemplates.issuePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('issueModel', () => { + const fakePath = "/rendered/path/issueModel"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + issue_model: "issueModelValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.issueModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.issueModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('issueModelPath', () => { + const result = client.issueModelPath("projectValue", "locationValue", "issueModelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.issueModelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromIssueModelName', () => { + const result = client.matchProjectFromIssueModelName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.issueModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromIssueModelName', () => { + const result = client.matchLocationFromIssueModelName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.issueModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchIssueModelFromIssueModelName', () => { + const result = client.matchIssueModelFromIssueModelName(fakePath); + assert.strictEqual(result, "issueModelValue"); + assert((client.pathTemplates.issueModelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('phraseMatcher', () => { + const fakePath = "/rendered/path/phraseMatcher"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + phrase_matcher: "phraseMatcherValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.phraseMatcherPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.phraseMatcherPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('phraseMatcherPath', () => { + const result = client.phraseMatcherPath("projectValue", "locationValue", "phraseMatcherValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.phraseMatcherPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromPhraseMatcherName', () => { + const result = client.matchProjectFromPhraseMatcherName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.phraseMatcherPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromPhraseMatcherName', () => { + const result = client.matchLocationFromPhraseMatcherName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.phraseMatcherPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchPhraseMatcherFromPhraseMatcherName', () => { + const result = client.matchPhraseMatcherFromPhraseMatcherName(fakePath); + assert.strictEqual(result, "phraseMatcherValue"); + assert((client.pathTemplates.phraseMatcherPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('settings', () => { + const fakePath = "/rendered/path/settings"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.settingsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.settingsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('settingsPath', () => { + const result = client.settingsPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.settingsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSettingsName', () => { + const result = client.matchProjectFromSettingsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSettingsName', () => { + const result = client.matchLocationFromSettingsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('view', () => { + const fakePath = "/rendered/path/view"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + view: "viewValue", + }; + const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.viewPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.viewPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('viewPath', () => { + const result = client.viewPath("projectValue", "locationValue", "viewValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.viewPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromViewName', () => { + const result = client.matchProjectFromViewName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.viewPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromViewName', () => { + const result = client.matchLocationFromViewName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.viewPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchViewFromViewName', () => { + const result = client.matchViewFromViewName(fakePath); + assert.strictEqual(result, "viewValue"); + assert((client.pathTemplates.viewPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js new file mode 100644 index 00000000000..97e7287c607 --- /dev/null +++ b/owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ContactCenterInsights', + filename: './contact-center-insights.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 5a6cf218d2aee11ffa8ee7507395c46b59b95358 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 13 Dec 2022 22:30:04 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../v1/.eslintignore | 7 - .../v1/.eslintrc.json | 3 - .../v1/.gitignore | 14 - .../v1/.jsdoc.js | 55 - .../v1/.mocharc.js | 33 - .../v1/.prettierrc.js | 22 - .../v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../v1/package.json | 64 - .../v1/contact_center_insights.proto | 1263 ---- .../contactcenterinsights/v1/resources.proto | 1180 ---- ...er_insights.calculate_issue_model_stats.js | 61 - ...contact_center_insights.calculate_stats.js | 66 - ...contact_center_insights.create_analysis.js | 67 - ...act_center_insights.create_conversation.js | 74 - ...tact_center_insights.create_issue_model.js | 67 - ...t_center_insights.create_phrase_matcher.js | 69 - .../v1/contact_center_insights.create_view.js | 69 - ...contact_center_insights.delete_analysis.js | 61 - ...act_center_insights.delete_conversation.js | 67 - ...tact_center_insights.delete_issue_model.js | 62 - ...t_center_insights.delete_phrase_matcher.js | 61 - .../v1/contact_center_insights.delete_view.js | 61 - ...tact_center_insights.deploy_issue_model.js | 62 - ...ct_center_insights.export_insights_data.js | 81 - .../contact_center_insights.get_analysis.js | 61 - ...ontact_center_insights.get_conversation.js | 65 - .../v1/contact_center_insights.get_issue.js | 61 - ...contact_center_insights.get_issue_model.js | 61 - ...tact_center_insights.get_phrase_matcher.js | 61 - .../contact_center_insights.get_settings.js | 61 - .../v1/contact_center_insights.get_view.js | 61 - .../contact_center_insights.list_analyses.js | 81 - ...tact_center_insights.list_conversations.js | 85 - ...ntact_center_insights.list_issue_models.js | 61 - .../v1/contact_center_insights.list_issues.js | 61 - ...ct_center_insights.list_phrase_matchers.js | 81 - .../v1/contact_center_insights.list_views.js | 76 - ...ct_center_insights.undeploy_issue_model.js | 62 - ...act_center_insights.update_conversation.js | 65 - .../contact_center_insights.update_issue.js | 65 - ...tact_center_insights.update_issue_model.js | 65 - ...t_center_insights.update_phrase_matcher.js | 65 - ...contact_center_insights.update_settings.js | 66 - .../v1/contact_center_insights.update_view.js | 65 - ...google.cloud.contactcenterinsights.v1.json | 1643 ----- .../v1/src/index.ts | 25 - .../src/v1/contact_center_insights_client.ts | 4370 ------------- ...contact_center_insights_client_config.json | 223 - .../contact_center_insights_proto_list.json | 4 - .../v1/src/v1/gapic_metadata.json | 409 -- .../v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../test/gapic_contact_center_insights_v1.ts | 5775 ----------------- .../v1/tsconfig.json | 19 - .../v1/webpack.config.js | 64 - .../README.md | 3 + .../v1/contact_center_insights.proto | 169 + .../contactcenterinsights/v1/resources.proto | 64 + .../protos/protos.d.ts | 1766 ++++- .../protos/protos.js | 4459 +++++++++++-- .../protos/protos.json | 346 +- .../samples/README.md | 54 + ...ter_insights.bulk_analyze_conversations.js | 0 .../contact_center_insights.delete_issue.js | 0 ...ct_center_insights.ingest_conversations.js | 0 ...google.cloud.contactcenterinsights.v1.json | 144 + .../src/v1/contact_center_insights_client.ts | 424 ++ ...contact_center_insights_client_config.json | 15 + .../src/v1/gapic_metadata.json | 30 + .../test/gapic_contact_center_insights_v1.ts | 538 ++ 73 files changed, 7284 insertions(+), 18302 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js rename {owl-bot-staging/google-cloud-contactcenterinsights/v1 => packages/google-cloud-contactcenterinsights}/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js (100%) rename {owl-bot-staging/google-cloud-contactcenterinsights/v1 => packages/google-cloud-contactcenterinsights}/samples/generated/v1/contact_center_insights.delete_issue.js (100%) rename {owl-bot-staging/google-cloud-contactcenterinsights/v1 => packages/google-cloud-contactcenterinsights}/samples/generated/v1/contact_center_insights.ingest_conversations.js (100%) diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js deleted file mode 100644 index 176aa3b31d0..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/contact-center-insights', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js deleted file mode 100644 index 481c522b00f..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js deleted file mode 100644 index 494e147865d..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md b/owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md deleted file mode 100644 index eabc434ea0d..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Contactcenterinsights: Nodejs Client diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json deleted file mode 100644 index 87ba02bdf50..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/contact-center-insights", - "version": "0.1.0", - "description": "Contactcenterinsights client for Node.js", - "repository": "googleapis/nodejs-contactcenterinsights", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google contactcenterinsights", - "contactcenterinsights", - "contact center insights" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.2" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.62", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto b/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto deleted file mode 100644 index 1ecf4321683..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto +++ /dev/null @@ -1,1263 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.contactcenterinsights.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/contactcenterinsights/v1/resources.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.ContactCenterInsights.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/contactcenterinsights/v1;contactcenterinsights"; -option java_multiple_files = true; -option java_outer_classname = "ContactCenterInsightsProto"; -option java_package = "com.google.cloud.contactcenterinsights.v1"; -option php_namespace = "Google\\Cloud\\ContactCenterInsights\\V1"; -option ruby_package = "Google::Cloud::ContactCenterInsights::V1"; - -// An API that lets users analyze and explore their business conversation data. -service ContactCenterInsights { - option (google.api.default_host) = "contactcenterinsights.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a conversation. - rpc CreateConversation(CreateConversationRequest) returns (Conversation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/conversations" - body: "conversation" - }; - option (google.api.method_signature) = "parent,conversation,conversation_id"; - } - - // Updates a conversation. - rpc UpdateConversation(UpdateConversationRequest) returns (Conversation) { - option (google.api.http) = { - patch: "/v1/{conversation.name=projects/*/locations/*/conversations/*}" - body: "conversation" - }; - option (google.api.method_signature) = "conversation,update_mask"; - } - - // Gets a conversation. - rpc GetConversation(GetConversationRequest) returns (Conversation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/conversations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists conversations. - rpc ListConversations(ListConversationsRequest) returns (ListConversationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/conversations" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a conversation. - rpc DeleteConversation(DeleteConversationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/conversations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an analysis. The long running operation is done when the analysis - // has completed. - rpc CreateAnalysis(CreateAnalysisRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/conversations/*}/analyses" - body: "analysis" - }; - option (google.api.method_signature) = "parent,analysis"; - option (google.longrunning.operation_info) = { - response_type: "Analysis" - metadata_type: "CreateAnalysisOperationMetadata" - }; - } - - // Gets an analysis. - rpc GetAnalysis(GetAnalysisRequest) returns (Analysis) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/conversations/*/analyses/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists analyses. - rpc ListAnalyses(ListAnalysesRequest) returns (ListAnalysesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/conversations/*}/analyses" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an analysis. - rpc DeleteAnalysis(DeleteAnalysisRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/conversations/*/analyses/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Analyzes multiple conversations in a single request. - rpc BulkAnalyzeConversations(BulkAnalyzeConversationsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/conversations:bulkAnalyze" - body: "*" - }; - option (google.api.method_signature) = "parent,filter,analysis_percentage"; - option (google.longrunning.operation_info) = { - response_type: "BulkAnalyzeConversationsResponse" - metadata_type: "BulkAnalyzeConversationsMetadata" - }; - } - - // Imports conversations and processes them according to the user's - // configuration. - rpc IngestConversations(IngestConversationsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/conversations:ingest" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "IngestConversationsResponse" - metadata_type: "IngestConversationsMetadata" - }; - } - - // Export insights data to a destination defined in the request body. - rpc ExportInsightsData(ExportInsightsDataRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/insightsdata:export" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "ExportInsightsDataResponse" - metadata_type: "ExportInsightsDataMetadata" - }; - } - - // Creates an issue model. - rpc CreateIssueModel(CreateIssueModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/issueModels" - body: "issue_model" - }; - option (google.api.method_signature) = "parent,issue_model"; - option (google.longrunning.operation_info) = { - response_type: "IssueModel" - metadata_type: "CreateIssueModelMetadata" - }; - } - - // Updates an issue model. - rpc UpdateIssueModel(UpdateIssueModelRequest) returns (IssueModel) { - option (google.api.http) = { - patch: "/v1/{issue_model.name=projects/*/locations/*/issueModels/*}" - body: "issue_model" - }; - option (google.api.method_signature) = "issue_model,update_mask"; - } - - // Gets an issue model. - rpc GetIssueModel(GetIssueModelRequest) returns (IssueModel) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/issueModels/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists issue models. - rpc ListIssueModels(ListIssueModelsRequest) returns (ListIssueModelsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/issueModels" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an issue model. - rpc DeleteIssueModel(DeleteIssueModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/issueModels/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteIssueModelMetadata" - }; - } - - // Deploys an issue model. Returns an error if a model is already deployed. - // An issue model can only be used in analysis after it has been deployed. - rpc DeployIssueModel(DeployIssueModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/issueModels/*}:deploy" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "DeployIssueModelResponse" - metadata_type: "DeployIssueModelMetadata" - }; - } - - // Undeploys an issue model. - // An issue model can not be used in analysis after it has been undeployed. - rpc UndeployIssueModel(UndeployIssueModelRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/issueModels/*}:undeploy" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "UndeployIssueModelResponse" - metadata_type: "UndeployIssueModelMetadata" - }; - } - - // Gets an issue. - rpc GetIssue(GetIssueRequest) returns (Issue) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists issues. - rpc ListIssues(ListIssuesRequest) returns (ListIssuesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/issueModels/*}/issues" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an issue. - rpc UpdateIssue(UpdateIssueRequest) returns (Issue) { - option (google.api.http) = { - patch: "/v1/{issue.name=projects/*/locations/*/issueModels/*/issues/*}" - body: "issue" - }; - option (google.api.method_signature) = "issue,update_mask"; - } - - // Deletes an issue. - rpc DeleteIssue(DeleteIssueRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets an issue model's statistics. - rpc CalculateIssueModelStats(CalculateIssueModelStatsRequest) returns (CalculateIssueModelStatsResponse) { - option (google.api.http) = { - get: "/v1/{issue_model=projects/*/locations/*/issueModels/*}:calculateIssueModelStats" - }; - option (google.api.method_signature) = "issue_model"; - } - - // Creates a phrase matcher. - rpc CreatePhraseMatcher(CreatePhraseMatcherRequest) returns (PhraseMatcher) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/phraseMatchers" - body: "phrase_matcher" - }; - option (google.api.method_signature) = "parent,phrase_matcher"; - } - - // Gets a phrase matcher. - rpc GetPhraseMatcher(GetPhraseMatcherRequest) returns (PhraseMatcher) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/phraseMatchers/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists phrase matchers. - rpc ListPhraseMatchers(ListPhraseMatchersRequest) returns (ListPhraseMatchersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/phraseMatchers" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a phrase matcher. - rpc DeletePhraseMatcher(DeletePhraseMatcherRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/phraseMatchers/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a phrase matcher. - rpc UpdatePhraseMatcher(UpdatePhraseMatcherRequest) returns (PhraseMatcher) { - option (google.api.http) = { - patch: "/v1/{phrase_matcher.name=projects/*/locations/*/phraseMatchers/*}" - body: "phrase_matcher" - }; - option (google.api.method_signature) = "phrase_matcher,update_mask"; - } - - // Gets conversation statistics. - rpc CalculateStats(CalculateStatsRequest) returns (CalculateStatsResponse) { - option (google.api.http) = { - get: "/v1/{location=projects/*/locations/*}/conversations:calculateStats" - }; - option (google.api.method_signature) = "location"; - } - - // Gets project-level settings. - rpc GetSettings(GetSettingsRequest) returns (Settings) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/settings}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates project-level settings. - rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) { - option (google.api.http) = { - patch: "/v1/{settings.name=projects/*/locations/*/settings}" - body: "settings" - }; - option (google.api.method_signature) = "settings,update_mask"; - } - - // Creates a view. - rpc CreateView(CreateViewRequest) returns (View) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/views" - body: "view" - }; - option (google.api.method_signature) = "parent,view"; - } - - // Gets a view. - rpc GetView(GetViewRequest) returns (View) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/views/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists views. - rpc ListViews(ListViewsRequest) returns (ListViewsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/views" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a view. - rpc UpdateView(UpdateViewRequest) returns (View) { - option (google.api.http) = { - patch: "/v1/{view.name=projects/*/locations/*/views/*}" - body: "view" - }; - option (google.api.method_signature) = "view,update_mask"; - } - - // Deletes a view. - rpc DeleteView(DeleteViewRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/views/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Represents the options for viewing a conversation. -enum ConversationView { - // The conversation view is not specified. - // - // * Defaults to `FULL` in `GetConversationRequest`. - // * Defaults to `BASIC` in `ListConversationsRequest`. - CONVERSATION_VIEW_UNSPECIFIED = 0; - - // Populates all fields in the conversation. - FULL = 2; - - // Populates all fields in the conversation except the transcript. - BASIC = 1; -} - -// The request for calculating conversation statistics. -message CalculateStatsRequest { - // Required. The location of the conversations. - string location = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // A filter to reduce results to a specific subset. This field is useful for - // getting statistics about conversations with specific properties. - string filter = 2; -} - -// The response for calculating conversation statistics. -message CalculateStatsResponse { - // A time series representing conversations over time. - message TimeSeries { - // A single interval in a time series. - message Interval { - // The start time of this interval. - google.protobuf.Timestamp start_time = 1; - - // The number of conversations created in this interval. - int32 conversation_count = 2; - } - - // The duration of each interval. - google.protobuf.Duration interval_duration = 1; - - // An ordered list of intervals from earliest to latest, where each interval - // represents the number of conversations that transpired during the time - // window. - repeated Interval points = 2; - } - - // The average duration of all conversations. The average is calculated using - // only conversations that have a time duration. - google.protobuf.Duration average_duration = 1; - - // The average number of turns per conversation. - int32 average_turn_count = 2; - - // The total number of conversations. - int32 conversation_count = 3; - - // A map associating each smart highlighter display name with its respective - // number of matches in the set of conversations. - map smart_highlighter_matches = 4; - - // A map associating each custom highlighter resource name with its respective - // number of matches in the set of conversations. - map custom_highlighter_matches = 5; - - // A map associating each issue resource name with its respective number of - // matches in the set of conversations. Key has the format: - // `projects//locations//issueModels//issues/` - // Deprecated, use `issue_matches_stats` field instead. - map issue_matches = 6 [deprecated = true]; - - // A map associating each issue resource name with its respective number of - // matches in the set of conversations. Key has the format: - // `projects//locations//issueModels//issues/` - map issue_matches_stats = 8; - - // A time series representing the count of conversations created over time - // that match that requested filter criteria. - TimeSeries conversation_count_time_series = 7; -} - -// Metadata for a create analysis operation. -message CreateAnalysisOperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Conversation that this Analysis Operation belongs to. - string conversation = 3 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Conversation" - } - ]; - - // Output only. The annotator selector used for the analysis (if any). - AnnotatorSelector annotator_selector = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request to create a conversation. -message CreateConversationRequest { - // Required. The parent resource of the conversation. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The conversation resource to create. - Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED]; - - // A unique ID for the new conversation. This ID will become the final - // component of the conversation's resource name. If no ID is specified, a - // server-generated ID will be used. - // - // This value should be 4-64 characters and must match the regular - // expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-` - string conversation_id = 3; -} - -// Request to list conversations. -message ListConversationsRequest { - // Required. The parent resource of the conversation. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of conversations to return in the response. A valid page - // size ranges from 0 to 1,000 inclusive. If the page size is zero or - // unspecified, a default page size of 100 will be chosen. Note that a call - // might return fewer results than the requested page size. - int32 page_size = 2; - - // The value returned by the last `ListConversationsResponse`. This value - // indicates that this is a continuation of a prior `ListConversations` call - // and that the system should return the next page of data. - string page_token = 3; - - // A filter to reduce results to a specific subset. Useful for querying - // conversations with specific properties. - string filter = 4; - - // The level of details of the conversation. Default is `BASIC`. - ConversationView view = 5; -} - -// The response of listing conversations. -message ListConversationsResponse { - // The conversations that match the request. - repeated Conversation conversations = 1; - - // A token which can be sent as `page_token` to retrieve the next page. If - // this field is set, it means there is another page available. If it is not - // set, it means no other pages are available. - string next_page_token = 2; -} - -// The request to get a conversation. -message GetConversationRequest { - // Required. The name of the conversation to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Conversation" - } - ]; - - // The level of details of the conversation. Default is `FULL`. - ConversationView view = 2; -} - -// The request to update a conversation. -message UpdateConversationRequest { - // Required. The new values for the conversation. - Conversation conversation = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// The request to delete a conversation. -message DeleteConversationRequest { - // Required. The name of the conversation to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Conversation" - } - ]; - - // If set to true, all of this conversation's analyses will also be deleted. - // Otherwise, the request will only succeed if the conversation has no - // analyses. - bool force = 2; -} - -// The request to ingest conversations. -message IngestConversationsRequest { - // Configuration for Cloud Storage bucket sources. - message GcsSource { - // Required. The Cloud Storage bucket containing source objects. - string bucket_uri = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Configuration for processing transcript objects. - message TranscriptObjectConfig { - // Required. The medium transcript objects represent. - Conversation.Medium medium = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Configuration that applies to all conversations. - message ConversationConfig { - // An opaque, user-specified string representing the human agent who handled - // the conversations. - string agent_id = 1; - } - - // Configuration for an external data store containing objects that will - // be converted to conversations. - oneof source { - // A cloud storage bucket source. - GcsSource gcs_source = 2; - } - - // Configuration for converting individual `source` objects to conversations. - oneof object_config { - // Configuration for when `source` contains conversation transcripts. - TranscriptObjectConfig transcript_object_config = 3; - } - - // Required. The parent resource for new conversations. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Configuration that applies to all conversations. - ConversationConfig conversation_config = 4; -} - -// The metadata for an IngestConversations operation. -message IngestConversationsMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The original request for ingest. - IngestConversationsRequest request = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Partial errors during ingest operation that might cause the operation - // output to be incomplete. - repeated google.rpc.Status partial_errors = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The response to an IngestConversations operation. -message IngestConversationsResponse { - -} - -// The request to create an analysis. -message CreateAnalysisRequest { - // Required. The parent resource of the analysis. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Conversation" - } - ]; - - // Required. The analysis to create. - Analysis analysis = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request to list analyses. -message ListAnalysesRequest { - // Required. The parent resource of the analyses. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Conversation" - } - ]; - - // The maximum number of analyses to return in the response. If this - // value is zero, the service will select a default size. A call might return - // fewer objects than requested. A non-empty `next_page_token` in the response - // indicates that more data is available. - int32 page_size = 2; - - // The value returned by the last `ListAnalysesResponse`; indicates - // that this is a continuation of a prior `ListAnalyses` call and - // the system should return the next page of data. - string page_token = 3; - - // A filter to reduce results to a specific subset. Useful for querying - // conversations with specific properties. - string filter = 4; -} - -// The response to list analyses. -message ListAnalysesResponse { - // The analyses that match the request. - repeated Analysis analyses = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The request to get an analysis. -message GetAnalysisRequest { - // Required. The name of the analysis to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Analysis" - } - ]; -} - -// The request to delete an analysis. -message DeleteAnalysisRequest { - // Required. The name of the analysis to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Analysis" - } - ]; -} - -// The request to analyze conversations in bulk. -message BulkAnalyzeConversationsRequest { - // Required. The parent resource to create analyses in. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. Filter used to select the subset of conversations to analyze. - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Percentage of selected conversation to analyze, between - // [0, 100]. - float analysis_percentage = 3 [(google.api.field_behavior) = REQUIRED]; - - // To select the annotators to run and the phrase matchers to use - // (if any). If not specified, all annotators will be run. - AnnotatorSelector annotator_selector = 8; -} - -// The metadata for a bulk analyze conversations operation. -message BulkAnalyzeConversationsMetadata { - // The time the operation was created. - google.protobuf.Timestamp create_time = 1; - - // The time the operation finished running. - google.protobuf.Timestamp end_time = 2; - - // The original request for bulk analyze. - BulkAnalyzeConversationsRequest request = 3; - - // The number of requested analyses that have completed successfully so far. - int32 completed_analyses_count = 4; - - // The number of requested analyses that have failed so far. - int32 failed_analyses_count = 5; - - // Total number of analyses requested. Computed by the number of conversations - // returned by `filter` multiplied by `analysis_percentage` in the request. - int32 total_requested_analyses_count = 6; -} - -// The response for a bulk analyze conversations operation. -message BulkAnalyzeConversationsResponse { - // Count of successful analyses. - int32 successful_analysis_count = 1; - - // Count of failed analyses. - int32 failed_analysis_count = 2; -} - -// The request to export insights. -message ExportInsightsDataRequest { - // A BigQuery Table Reference. - message BigQueryDestination { - // A project ID or number. If specified, then export will attempt to - // write data to this project instead of the resource project. Otherwise, - // the resource project will be used. - string project_id = 3; - - // Required. The name of the BigQuery dataset that the snapshot result should be - // exported to. If this dataset does not exist, the export call returns an - // INVALID_ARGUMENT error. - string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - - // The BigQuery table name to which the insights data should be written. - // If this table does not exist, the export call returns an INVALID_ARGUMENT - // error. - string table = 2; - } - - // Specifies the action that occurs if the destination table already exists. - enum WriteDisposition { - // Write disposition is not specified. Defaults to WRITE_TRUNCATE. - WRITE_DISPOSITION_UNSPECIFIED = 0; - - // If the table already exists, BigQuery will overwrite the table data and - // use the schema from the load. - WRITE_TRUNCATE = 1; - - // If the table already exists, BigQuery will append data to the table. - WRITE_APPEND = 2; - } - - // Exporter destination. - oneof destination { - // Specified if sink is a BigQuery table. - BigQueryDestination big_query_destination = 2; - } - - // Required. The parent resource to export data from. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // A filter to reduce results to a specific subset. Useful for exporting - // conversations with specific properties. - string filter = 3; - - // A fully qualified KMS key name for BigQuery tables protected by CMEK. - // Format: - // projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version} - string kms_key = 4; - - // Options for what to do if the destination table already exists. - WriteDisposition write_disposition = 5; -} - -// Metadata for an export insights operation. -message ExportInsightsDataMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The original request for export. - ExportInsightsDataRequest request = 3; - - // Partial errors during export operation that might cause the operation - // output to be incomplete. - repeated google.rpc.Status partial_errors = 4; -} - -// Response for an export insights operation. -message ExportInsightsDataResponse { - -} - -// The request to create an issue model. -message CreateIssueModelRequest { - // Required. The parent resource of the issue model. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The issue model to create. - IssueModel issue_model = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata for creating an issue model. -message CreateIssueModelMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The original request for creation. - CreateIssueModelRequest request = 3; -} - -// The request to update an issue model. -message UpdateIssueModelRequest { - // Required. The new values for the issue model. - IssueModel issue_model = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Request to list issue models. -message ListIssueModelsRequest { - // Required. The parent resource of the issue model. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; -} - -// The response of listing issue models. -message ListIssueModelsResponse { - // The issue models that match the request. - repeated IssueModel issue_models = 1; -} - -// The request to get an issue model. -message GetIssueModelRequest { - // Required. The name of the issue model to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - } - ]; -} - -// The request to delete an issue model. -message DeleteIssueModelRequest { - // Required. The name of the issue model to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - } - ]; -} - -// Metadata for deleting an issue model. -message DeleteIssueModelMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The original request for deletion. - DeleteIssueModelRequest request = 3; -} - -// The request to deploy an issue model. -message DeployIssueModelRequest { - // Required. The issue model to deploy. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - } - ]; -} - -// The response to deploy an issue model. -message DeployIssueModelResponse { - -} - -// Metadata for deploying an issue model. -message DeployIssueModelMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The original request for deployment. - DeployIssueModelRequest request = 3; -} - -// The request to undeploy an issue model. -message UndeployIssueModelRequest { - // Required. The issue model to undeploy. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - } - ]; -} - -// The response to undeploy an issue model. -message UndeployIssueModelResponse { - -} - -// Metadata for undeploying an issue model. -message UndeployIssueModelMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The original request for undeployment. - UndeployIssueModelRequest request = 3; -} - -// The request to get an issue. -message GetIssueRequest { - // Required. The name of the issue to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Issue" - } - ]; -} - -// Request to list issues. -message ListIssuesRequest { - // Required. The parent resource of the issue. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - } - ]; -} - -// The response of listing issues. -message ListIssuesResponse { - // The issues that match the request. - repeated Issue issues = 1; -} - -// The request to update an issue. -message UpdateIssueRequest { - // Required. The new values for the issue. - Issue issue = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// The request to delete an issue. -message DeleteIssueRequest { - // Required. The name of the issue to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Issue" - } - ]; -} - -// Request to get statistics of an issue model. -message CalculateIssueModelStatsRequest { - // Required. The resource name of the issue model to query against. - string issue_model = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - } - ]; -} - -// Response of querying an issue model's statistics. -message CalculateIssueModelStatsResponse { - // The latest label statistics for the queried issue model. Includes results - // on both training data and data labeled after deployment. - IssueModelLabelStats current_stats = 4; -} - -// Request to create a phrase matcher. -message CreatePhraseMatcherRequest { - // Required. The parent resource of the phrase matcher. Required. The location to create - // a phrase matcher for. - // Format: `projects//locations/` or - // `projects//locations/` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The phrase matcher resource to create. - PhraseMatcher phrase_matcher = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to list phrase matchers. -message ListPhraseMatchersRequest { - // Required. The parent resource of the phrase matcher. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of phrase matchers to return in the response. If this - // value is zero, the service will select a default size. A call might return - // fewer objects than requested. A non-empty `next_page_token` in the response - // indicates that more data is available. - int32 page_size = 2; - - // The value returned by the last `ListPhraseMatchersResponse`. This value - // indicates that this is a continuation of a prior `ListPhraseMatchers` call - // and that the system should return the next page of data. - string page_token = 3; - - // A filter to reduce results to a specific subset. Useful for querying - // phrase matchers with specific properties. - string filter = 4; -} - -// The response of listing phrase matchers. -message ListPhraseMatchersResponse { - // The phrase matchers that match the request. - repeated PhraseMatcher phrase_matchers = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The request to get a a phrase matcher. -message GetPhraseMatcherRequest { - // Required. The name of the phrase matcher to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/PhraseMatcher" - } - ]; -} - -// The request to delete a phrase matcher. -message DeletePhraseMatcherRequest { - // Required. The name of the phrase matcher to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/PhraseMatcher" - } - ]; -} - -// The request to update a phrase matcher. -message UpdatePhraseMatcherRequest { - // Required. The new values for the phrase matcher. - PhraseMatcher phrase_matcher = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// The request to get project-level settings. -message GetSettingsRequest { - // Required. The name of the settings resource to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/Settings" - } - ]; -} - -// The request to update project-level settings. -message UpdateSettingsRequest { - // Required. The new settings values. - Settings settings = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request to create a view. -message CreateViewRequest { - // Required. The parent resource of the view. Required. The location to create - // a view for. - // Format: `projects//locations/` or - // `projects//locations/` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The view resource to create. - View view = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request to get a view. -message GetViewRequest { - // Required. The name of the view to get. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/View" - } - ]; -} - -// The request to list views. -message ListViewsRequest { - // Required. The parent resource of the views. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of views to return in the response. If this - // value is zero, the service will select a default size. A call may return - // fewer objects than requested. A non-empty `next_page_token` in the response - // indicates that more data is available. - int32 page_size = 2; - - // The value returned by the last `ListViewsResponse`; indicates - // that this is a continuation of a prior `ListViews` call and - // the system should return the next page of data. - string page_token = 3; -} - -// The response of listing views. -message ListViewsResponse { - // The views that match the request. - repeated View views = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// The request to update a view. -message UpdateViewRequest { - // Required. The new view. - View view = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// The request to delete a view. -message DeleteViewRequest { - // Required. The name of the view to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/View" - } - ]; -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto b/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto deleted file mode 100644 index 715eff61177..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/protos/google/cloud/contactcenterinsights/v1/resources.proto +++ /dev/null @@ -1,1180 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.contactcenterinsights.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ContactCenterInsights.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/contactcenterinsights/v1;contactcenterinsights"; -option java_multiple_files = true; -option java_outer_classname = "ResourcesProto"; -option java_package = "com.google.cloud.contactcenterinsights.v1"; -option php_namespace = "Google\\Cloud\\ContactCenterInsights\\V1"; -option ruby_package = "Google::Cloud::ContactCenterInsights::V1"; -option (google.api.resource_definition) = { - type: "dialogflow.googleapis.com/Participant" - pattern: "projects/{project}/conversations/{conversation}/participants/{participant}" - pattern: "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" -}; - -// The conversation resource. -message Conversation { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/Conversation" - pattern: "projects/{project}/locations/{location}/conversations/{conversation}" - }; - - // Call-specific metadata. - message CallMetadata { - // The audio channel that contains the customer. - int32 customer_channel = 1; - - // The audio channel that contains the agent. - int32 agent_channel = 2; - } - - // A message representing the transcript of a conversation. - message Transcript { - // A segment of a full transcript. - message TranscriptSegment { - // Word-level info for words in a transcript. - message WordInfo { - // Time offset of the start of this word relative to the beginning of - // the total conversation. - google.protobuf.Duration start_offset = 1; - - // Time offset of the end of this word relative to the beginning of the - // total conversation. - google.protobuf.Duration end_offset = 2; - - // The word itself. Includes punctuation marks that surround the word. - string word = 3; - - // A confidence estimate between 0.0 and 1.0 of the fidelity of this - // word. A default value of 0.0 indicates that the value is unset. - float confidence = 4; - } - - // Metadata from Dialogflow relating to the current transcript segment. - message DialogflowSegmentMetadata { - // Whether the transcript segment was covered under the configured smart - // reply allowlist in Agent Assist. - bool smart_reply_allowlist_covered = 1; - } - - // The time that the message occurred, if provided. - google.protobuf.Timestamp message_time = 6; - - // The text of this segment. - string text = 1; - - // A confidence estimate between 0.0 and 1.0 of the fidelity of this - // segment. A default value of 0.0 indicates that the value is unset. - float confidence = 2; - - // A list of the word-specific information for each word in the segment. - repeated WordInfo words = 3; - - // The language code of this segment as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - string language_code = 4; - - // For conversations derived from multi-channel audio, this is the channel - // number corresponding to the audio from that channel. For - // audioChannelCount = N, its output values can range from '1' to 'N'. A - // channel tag of 0 indicates that the audio is mono. - int32 channel_tag = 5; - - // The participant of this segment. - ConversationParticipant segment_participant = 9; - - // CCAI metadata relating to the current transcript segment. - DialogflowSegmentMetadata dialogflow_segment_metadata = 10; - - // The sentiment for this transcript segment. - SentimentData sentiment = 11; - } - - // A list of sequential transcript segments that comprise the conversation. - repeated TranscriptSegment transcript_segments = 1; - } - - // Possible media for the conversation. - enum Medium { - // Default value, if unspecified will default to PHONE_CALL. - MEDIUM_UNSPECIFIED = 0; - - // The format for conversations that took place over the phone. - PHONE_CALL = 1; - - // The format for conversations that took place over chat. - CHAT = 2; - } - - // Metadata that applies to the conversation. - oneof metadata { - // Call-specific metadata. - CallMetadata call_metadata = 7; - } - - // A time to live expiration setting, can be either a specified timestamp or a - // duration from the time that the conversation creation request was received. - // Conversations with an expiration set will be removed up to 24 hours after - // the specified time. - oneof expiration { - // The time at which this conversation should expire. After this time, the - // conversation data and any associated analyses will be deleted. - google.protobuf.Timestamp expire_time = 15; - - // Input only. The TTL for this resource. If specified, then this TTL will - // be used to calculate the expire time. - google.protobuf.Duration ttl = 16 [(google.api.field_behavior) = INPUT_ONLY]; - } - - // Immutable. The resource name of the conversation. - // Format: - // projects/{project}/locations/{location}/conversations/{conversation} - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // The source of the audio and transcription for the conversation. - ConversationDataSource data_source = 2; - - // Output only. The time at which the conversation was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The most recent time at which the conversation was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The time at which the conversation started. - google.protobuf.Timestamp start_time = 17; - - // A user-specified language code for the conversation. - string language_code = 14; - - // An opaque, user-specified string representing the human agent who handled - // the conversation. - string agent_id = 5; - - // A map for the user to specify any custom fields. A maximum of 20 labels per - // conversation is allowed, with a maximum of 256 characters per entry. - map labels = 6; - - // Output only. The conversation transcript. - Transcript transcript = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The conversation medium, if unspecified will default to PHONE_CALL. - Medium medium = 9 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The duration of the conversation. - google.protobuf.Duration duration = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of turns in the conversation. - int32 turn_count = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The conversation's latest analysis, if one exists. - Analysis latest_analysis = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The annotations that were generated during the customer and agent - // interaction. - repeated RuntimeAnnotation runtime_annotations = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. All the matched Dialogflow intents in the call. The key corresponds to a - // Dialogflow intent, format: - // projects/{project}/agent/{agent}/intents/{intent} - map dialogflow_intents = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Obfuscated user ID which the customer sent to us. - string obfuscated_user_id = 21; -} - -// The analysis resource. -message Analysis { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/Analysis" - pattern: "projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}" - }; - - // Immutable. The resource name of the analysis. - // Format: - // projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis} - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The time at which the analysis was requested. - google.protobuf.Timestamp request_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the analysis was created, which occurs when the - // long-running operation completes. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The result of the analysis, which is populated when the analysis - // finishes. - AnalysisResult analysis_result = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // To select the annotators to run and the phrase matchers to use - // (if any). If not specified, all annotators will be run. - AnnotatorSelector annotator_selector = 8; -} - -// The conversation source, which is a combination of transcript and audio. -message ConversationDataSource { - // The source of the conversation. - oneof source { - // A Cloud Storage location specification for the audio and transcript. - GcsSource gcs_source = 1; - - // The source when the conversation comes from Dialogflow. - DialogflowSource dialogflow_source = 3; - } -} - -// A Cloud Storage source of conversation data. -message GcsSource { - // Cloud Storage URI that points to a file that contains the conversation - // audio. - string audio_uri = 1; - - // Immutable. Cloud Storage URI that points to a file that contains the conversation - // transcript. - string transcript_uri = 2 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A Dialogflow source of conversation data. -message DialogflowSource { - // Output only. The name of the Dialogflow conversation that this conversation - // resource is derived from. Format: - // projects/{project}/locations/{location}/conversations/{conversation} - string dialogflow_conversation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Cloud Storage URI that points to a file that contains the conversation - // audio. - string audio_uri = 3; -} - -// The result of an analysis. -message AnalysisResult { - // Call-specific metadata created during analysis. - message CallAnalysisMetadata { - // A list of call annotations that apply to this call. - repeated CallAnnotation annotations = 2; - - // All the entities in the call. - map entities = 3; - - // Overall conversation-level sentiment for each channel of the call. - repeated ConversationLevelSentiment sentiments = 4; - - // All the matched intents in the call. - map intents = 6; - - // All the matched phrase matchers in the call. - map phrase_matchers = 7; - - // Overall conversation-level issue modeling result. - IssueModelResult issue_model_result = 8; - } - - // Metadata discovered during analysis. - oneof metadata { - // Call-specific metadata created by the analysis. - CallAnalysisMetadata call_analysis_metadata = 2; - } - - // The time at which the analysis ended. - google.protobuf.Timestamp end_time = 1; -} - -// Issue Modeling result on a conversation. -message IssueModelResult { - // Issue model that generates the result. - // Format: projects/{project}/locations/{location}/issueModels/{issue_model} - string issue_model = 1 [(google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - }]; - - // All the matched issues. - repeated IssueAssignment issues = 2; -} - -// One channel of conversation-level sentiment data. -message ConversationLevelSentiment { - // The channel of the audio that the data applies to. - int32 channel_tag = 1; - - // Data specifying sentiment. - SentimentData sentiment_data = 2; -} - -// Information about the issue. -message IssueAssignment { - // Resource name of the assigned issue. - string issue = 1; - - // Score indicating the likelihood of the issue assignment. - // currently bounded on [0,1]. - double score = 2; - - // Immutable. Display name of the assigned issue. This field is set at time of analyis - // and immutable since then. - string display_name = 3 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A piece of metadata that applies to a window of a call. -message CallAnnotation { - // The data in the annotation. - oneof data { - // Data specifying an interruption. - InterruptionData interruption_data = 10; - - // Data specifying sentiment. - SentimentData sentiment_data = 11; - - // Data specifying silence. - SilenceData silence_data = 12; - - // Data specifying a hold. - HoldData hold_data = 13; - - // Data specifying an entity mention. - EntityMentionData entity_mention_data = 15; - - // Data specifying an intent match. - IntentMatchData intent_match_data = 16; - - // Data specifying a phrase match. - PhraseMatchData phrase_match_data = 17; - - // Data specifying an issue match. - IssueMatchData issue_match_data = 18; - } - - // The channel of the audio where the annotation occurs. For single-channel - // audio, this field is not populated. - int32 channel_tag = 1; - - // The boundary in the conversation where the annotation starts, inclusive. - AnnotationBoundary annotation_start_boundary = 4; - - // The boundary in the conversation where the annotation ends, inclusive. - AnnotationBoundary annotation_end_boundary = 5; -} - -// A point in a conversation that marks the start or the end of an annotation. -message AnnotationBoundary { - // A detailed boundary, which describes a more specific point. - oneof detailed_boundary { - // The word index of this boundary with respect to the first word in the - // transcript piece. This index starts at zero. - int32 word_index = 3; - } - - // The index in the sequence of transcribed pieces of the conversation where - // the boundary is located. This index starts at zero. - int32 transcript_index = 1; -} - -// The data for an entity annotation. -// Represents a phrase in the conversation that is a known entity, such -// as a person, an organization, or location. -message Entity { - // The type of the entity. For most entity types, the associated metadata is a - // Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`). The table - // below lists the associated fields for entities that have different - // metadata. - enum Type { - // Unspecified. - TYPE_UNSPECIFIED = 0; - - // Person. - PERSON = 1; - - // Location. - LOCATION = 2; - - // Organization. - ORGANIZATION = 3; - - // Event. - EVENT = 4; - - // Artwork. - WORK_OF_ART = 5; - - // Consumer product. - CONSUMER_GOOD = 6; - - // Other types of entities. - OTHER = 7; - - // Phone number. - // - // The metadata lists the phone number (formatted according to local - // convention), plus whichever additional elements appear in the text: - // - // * `number` - The actual number, broken down into sections according to - // local convention. - // * `national_prefix` - Country code, if detected. - // * `area_code` - Region or area code, if detected. - // * `extension` - Phone extension (to be dialed after connection), if - // detected. - PHONE_NUMBER = 9; - - // Address. - // - // The metadata identifies the street number and locality plus whichever - // additional elements appear in the text: - // - // * `street_number` - Street number. - // * `locality` - City or town. - // * `street_name` - Street/route name, if detected. - // * `postal_code` - Postal code, if detected. - // * `country` - Country, if detected. - // * `broad_region` - Administrative area, such as the state, if detected. - // * `narrow_region` - Smaller administrative area, such as county, if - // detected. - // * `sublocality` - Used in Asian addresses to demark a district within a - // city, if detected. - ADDRESS = 10; - - // Date. - // - // The metadata identifies the components of the date: - // - // * `year` - Four digit year, if detected. - // * `month` - Two digit month number, if detected. - // * `day` - Two digit day number, if detected. - DATE = 11; - - // Number. - // - // The metadata is the number itself. - NUMBER = 12; - - // Price. - // - // The metadata identifies the `value` and `currency`. - PRICE = 13; - } - - // The representative name for the entity. - string display_name = 1; - - // The entity type. - Type type = 2; - - // Metadata associated with the entity. - // - // For most entity types, the metadata is a Wikipedia URL (`wikipedia_url`) - // and Knowledge Graph MID (`mid`), if they are available. For the metadata - // associated with other entity types, see the Type table below. - map metadata = 3; - - // The salience score associated with the entity in the [0, 1.0] range. - // - // The salience score for an entity provides information about the - // importance or centrality of that entity to the entire document text. - // Scores closer to 0 are less salient, while scores closer to 1.0 are highly - // salient. - float salience = 4; - - // The aggregate sentiment expressed for this entity in the conversation. - SentimentData sentiment = 5; -} - -// The data for an intent. -// Represents a detected intent in the conversation, for example MAKES_PROMISE. -message Intent { - // The unique identifier of the intent. - string id = 1; - - // The human-readable name of the intent. - string display_name = 2; -} - -// The data for a matched phrase matcher. -// Represents information identifying a phrase matcher for a given match. -message PhraseMatchData { - // The unique identifier (the resource name) of the phrase matcher. - string phrase_matcher = 1; - - // The human-readable name of the phrase matcher. - string display_name = 2; -} - -// The data for a Dialogflow intent. -// Represents a detected intent in the conversation, e.g. MAKES_PROMISE. -message DialogflowIntent { - // The human-readable name of the intent. - string display_name = 1; -} - -// The data for an interruption annotation. -message InterruptionData { - -} - -// The data for a silence annotation. -message SilenceData { - -} - -// The data for a hold annotation. -message HoldData { - -} - -// The data for an entity mention annotation. -// This represents a mention of an `Entity` in the conversation. -message EntityMentionData { - // The supported types of mentions. - enum MentionType { - // Unspecified. - MENTION_TYPE_UNSPECIFIED = 0; - - // Proper noun. - PROPER = 1; - - // Common noun (or noun compound). - COMMON = 2; - } - - // The key of this entity in conversation entities. - // Can be used to retrieve the exact `Entity` this mention is attached to. - string entity_unique_id = 1; - - // The type of the entity mention. - MentionType type = 2; - - // Sentiment expressed for this mention of the entity. - SentimentData sentiment = 3; -} - -// The data for an intent match. -// Represents an intent match for a text segment in the conversation. A text -// segment can be part of a sentence, a complete sentence, or an utterance -// with multiple sentences. -message IntentMatchData { - // The id of the matched intent. - // Can be used to retrieve the corresponding intent information. - string intent_unique_id = 1; -} - -// The data for a sentiment annotation. -message SentimentData { - // A non-negative number from 0 to infinity which represents the abolute - // magnitude of sentiment regardless of score. - float magnitude = 1; - - // The sentiment score between -1.0 (negative) and 1.0 (positive). - float score = 2; -} - -// The data for an issue match annotation. -message IssueMatchData { - // Information about the issue's assignment. - IssueAssignment issue_assignment = 1; -} - -// The issue model resource. -message IssueModel { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - pattern: "projects/{project}/locations/{location}/issueModels/{issue_model}" - }; - - // Configs for the input data used to create the issue model. - message InputDataConfig { - // Medium of conversations used in training data. This field is being - // deprecated. To specify the medium to be used in training a new issue - // model, set the `medium` field on `filter`. - Conversation.Medium medium = 1 [deprecated = true]; - - // Output only. Number of conversations used in training. Output only. - int64 training_conversations_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A filter to reduce the conversations used for training the model to a - // specific subset. - string filter = 3; - } - - // State of the model. - enum State { - // Unspecified. - STATE_UNSPECIFIED = 0; - - // Model is not deployed but is ready to deploy. - UNDEPLOYED = 1; - - // Model is being deployed. - DEPLOYING = 2; - - // Model is deployed and is ready to be used. A model can only be used in - // analysis if it's in this state. - DEPLOYED = 3; - - // Model is being undeployed. - UNDEPLOYING = 4; - - // Model is being deleted. - DELETING = 5; - } - - // Immutable. The resource name of the issue model. - // Format: - // projects/{project}/locations/{location}/issueModels/{issue_model} - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // The representative name for the issue model. - string display_name = 2; - - // Output only. The time at which this issue model was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The most recent time at which the issue model was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. State of the model. - State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configs for the input data that used to create the issue model. - InputDataConfig input_data_config = 6; - - // Output only. Immutable. The issue model's label statistics on its training data. - IssueModelLabelStats training_stats = 7 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IMMUTABLE - ]; -} - -// The issue resource. -message Issue { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/Issue" - pattern: "projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}" - }; - - // Immutable. The resource name of the issue. - // Format: - // projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue} - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // The representative name for the issue. - string display_name = 2; - - // Output only. The time at which this issue was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The most recent time that this issue was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Resource names of the sample representative utterances that match to this - // issue. - repeated string sample_utterances = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Aggregated statistics about an issue model. -message IssueModelLabelStats { - // Aggregated statistics about an issue. - message IssueStats { - // Issue resource. - // Format: - // projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue} - string issue = 1; - - // Number of conversations attached to the issue at this point in time. - int64 labeled_conversations_count = 2; - - // Display name of the issue. - string display_name = 3; - } - - // Number of conversations the issue model has analyzed at this point in time. - int64 analyzed_conversations_count = 1; - - // Number of analyzed conversations for which no issue was applicable at this - // point in time. - int64 unclassified_conversations_count = 2; - - // Statistics on each issue. Key is the issue's resource name. - map issue_stats = 3; -} - -// The phrase matcher resource. -message PhraseMatcher { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/PhraseMatcher" - pattern: "projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}" - }; - - // Specifies how to combine each phrase match rule group to determine whether - // there is a match. - enum PhraseMatcherType { - // Unspecified. - PHRASE_MATCHER_TYPE_UNSPECIFIED = 0; - - // Must meet all phrase match rule groups or there is no match. - ALL_OF = 1; - - // If any of the phrase match rule groups are met, there is a match. - ANY_OF = 2; - } - - // The resource name of the phrase matcher. - // Format: - // projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher} - string name = 1; - - // Output only. Immutable. The revision ID of the phrase matcher. - // A new revision is committed whenever the matcher is changed, except when it - // is activated or deactivated. A server generated random ID will be used. - // Example: locations/global/phraseMatchers/my-first-matcher@1234567 - string revision_id = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // The customized version tag to use for the phrase matcher. If not specified, - // it will default to `revision_id`. - string version_tag = 3; - - // Output only. The timestamp of when the revision was created. It is also the create time - // when a new matcher is added. - google.protobuf.Timestamp revision_create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The human-readable name of the phrase matcher. - string display_name = 5; - - // Required. The type of this phrase matcher. - PhraseMatcherType type = 6 [(google.api.field_behavior) = REQUIRED]; - - // Applies the phrase matcher only when it is active. - bool active = 7; - - // A list of phase match rule groups that are included in this matcher. - repeated PhraseMatchRuleGroup phrase_match_rule_groups = 8; - - // Output only. The most recent time at which the activation status was updated. - google.protobuf.Timestamp activation_update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The role whose utterances the phrase matcher should be matched - // against. If the role is ROLE_UNSPECIFIED it will be matched against any - // utterances in the transcript. - ConversationParticipant.Role role_match = 10; - - // Output only. The most recent time at which the phrase matcher was updated. - google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A message representing a rule in the phrase matcher. -message PhraseMatchRuleGroup { - // Specifies how to combine each phrase match rule for whether there is a - // match. - enum PhraseMatchRuleGroupType { - // Unspecified. - PHRASE_MATCH_RULE_GROUP_TYPE_UNSPECIFIED = 0; - - // Must meet all phrase match rules or there is no match. - ALL_OF = 1; - - // If any of the phrase match rules are met, there is a match. - ANY_OF = 2; - } - - // Required. The type of this phrase match rule group. - PhraseMatchRuleGroupType type = 1 [(google.api.field_behavior) = REQUIRED]; - - // A list of phase match rules that are included in this group. - repeated PhraseMatchRule phrase_match_rules = 2; -} - -// The data for a phrase match rule. -message PhraseMatchRule { - // Required. The phrase to be matched. - string query = 1 [(google.api.field_behavior) = REQUIRED]; - - // Specifies whether the phrase must be missing from the transcript segment or - // present in the transcript segment. - bool negated = 2; - - // Provides additional information about the rule that specifies how to apply - // the rule. - PhraseMatchRuleConfig config = 3; -} - -// Configuration information of a phrase match rule. -message PhraseMatchRuleConfig { - // The configuration of the phrase match rule. - oneof config { - // The configuration for the exact match rule. - ExactMatchConfig exact_match_config = 1; - } -} - -// Exact match configuration. -message ExactMatchConfig { - // Whether to consider case sensitivity when performing an exact match. - bool case_sensitive = 1; -} - -// The settings resource. -message Settings { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/Settings" - pattern: "projects/{project}/locations/{location}/settings" - }; - - // Default configuration when creating Analyses in Insights. - message AnalysisConfig { - // Percentage of conversations created using Dialogflow runtime integration - // to analyze automatically, between [0, 100]. - double runtime_integration_analysis_percentage = 1; - - // To select the annotators to run and the phrase matchers to use - // (if any). If not specified, all annotators will be run. - AnnotatorSelector annotator_selector = 5; - } - - // Immutable. The resource name of the settings resource. - // Format: - // projects/{project}/locations/{location}/settings - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The time at which the settings was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which the settings were last updated. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A language code to be applied to each transcript segment unless the segment - // already specifies a language code. Language code defaults to "en-US" if it - // is neither specified on the segment nor here. - string language_code = 4; - - // The default TTL for newly-created conversations. If a conversation has a - // specified expiration, that value will be used instead. Changing this - // value will not change the expiration of existing conversations. - // Conversations with no expire time persist until they are deleted. - google.protobuf.Duration conversation_ttl = 5; - - // A map that maps a notification trigger to a Pub/Sub topic. Each time a - // specified trigger occurs, Insights will notify the corresponding Pub/Sub - // topic. - // - // Keys are notification triggers. Supported keys are: - // - // * "all-triggers": Notify each time any of the supported triggers occurs. - // * "create-analysis": Notify each time an analysis is created. - // * "create-conversation": Notify each time a conversation is created. - // * "export-insights-data": Notify each time an export is complete. - // * "update-conversation": Notify each time a conversation is updated via - // UpdateConversation. - // - // Values are Pub/Sub topics. The format of each Pub/Sub topic is: - // projects/{project}/topics/{topic} - map pubsub_notification_settings = 6; - - // Default analysis settings. - AnalysisConfig analysis_config = 7; -} - -// An annotation that was generated during the customer and agent interaction. -message RuntimeAnnotation { - // The data in the annotation. - oneof data { - // Agent Assist Article Suggestion data. - ArticleSuggestionData article_suggestion = 6; - - // Agent Assist FAQ answer data. - FaqAnswerData faq_answer = 7; - - // Agent Assist Smart Reply data. - SmartReplyData smart_reply = 8; - - // Agent Assist Smart Compose suggestion data. - SmartComposeSuggestionData smart_compose_suggestion = 9; - - // Dialogflow interaction data. - DialogflowInteractionData dialogflow_interaction = 10; - } - - // The unique identifier of the annotation. - // Format: - // projects/{project}/locations/{location}/conversationDatasets/{dataset}/conversationDataItems/{data_item}/conversationAnnotations/{annotation} - string annotation_id = 1; - - // The time at which this annotation was created. - google.protobuf.Timestamp create_time = 2; - - // The boundary in the conversation where the annotation starts, inclusive. - AnnotationBoundary start_boundary = 3; - - // The boundary in the conversation where the annotation ends, inclusive. - AnnotationBoundary end_boundary = 4; - - // The feedback that the customer has about the answer in `data`. - AnswerFeedback answer_feedback = 5; -} - -// The feedback that the customer has about a certain answer in the -// conversation. -message AnswerFeedback { - // The correctness level of an answer. - enum CorrectnessLevel { - // Correctness level unspecified. - CORRECTNESS_LEVEL_UNSPECIFIED = 0; - - // Answer is totally wrong. - NOT_CORRECT = 1; - - // Answer is partially correct. - PARTIALLY_CORRECT = 2; - - // Answer is fully correct. - FULLY_CORRECT = 3; - } - - // The correctness level of an answer. - CorrectnessLevel correctness_level = 1; - - // Indicates whether an answer or item was clicked by the human agent. - bool clicked = 2; - - // Indicates whether an answer or item was displayed to the human agent in the - // agent desktop UI. - bool displayed = 3; -} - -// Agent Assist Article Suggestion data. -message ArticleSuggestionData { - // Article title. - string title = 1; - - // Article URI. - string uri = 2; - - // The system's confidence score that this article is a good match for this - // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely - // certain). - float confidence_score = 3; - - // Map that contains metadata about the Article Suggestion and the document - // that it originates from. - map metadata = 4; - - // The name of the answer record. - // Format: - // projects/{project}/locations/{location}/answerRecords/{answer_record} - string query_record = 5; - - // The knowledge document that this answer was extracted from. - // Format: - // projects/{project}/knowledgeBases/{knowledge_base}/documents/{document} - string source = 6; -} - -// Agent Assist frequently-asked-question answer data. -message FaqAnswerData { - // The piece of text from the `source` knowledge base document. - string answer = 1; - - // The system's confidence score that this answer is a good match for this - // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely - // certain). - float confidence_score = 2; - - // The corresponding FAQ question. - string question = 3; - - // Map that contains metadata about the FAQ answer and the document that - // it originates from. - map metadata = 4; - - // The name of the answer record. - // Format: - // projects/{project}/locations/{location}/answerRecords/{answer_record} - string query_record = 5; - - // The knowledge document that this answer was extracted from. - // Format: - // projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}. - string source = 6; -} - -// Agent Assist Smart Reply data. -message SmartReplyData { - // The content of the reply. - string reply = 1; - - // The system's confidence score that this reply is a good match for this - // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely - // certain). - double confidence_score = 2; - - // Map that contains metadata about the Smart Reply and the document from - // which it originates. - map metadata = 3; - - // The name of the answer record. - // Format: - // projects/{project}/locations/{location}/answerRecords/{answer_record} - string query_record = 4; -} - -// Agent Assist Smart Compose suggestion data. -message SmartComposeSuggestionData { - // The content of the suggestion. - string suggestion = 1; - - // The system's confidence score that this suggestion is a good match for this - // conversation, ranging from 0.0 (completely uncertain) to 1.0 (completely - // certain). - double confidence_score = 2; - - // Map that contains metadata about the Smart Compose suggestion and the - // document from which it originates. - map metadata = 3; - - // The name of the answer record. - // Format: - // projects/{project}/locations/{location}/answerRecords/{answer_record} - string query_record = 4; -} - -// Dialogflow interaction data. -message DialogflowInteractionData { - // The Dialogflow intent resource path. Format: - // projects/{project}/agent/{agent}/intents/{intent} - string dialogflow_intent_id = 1; - - // The confidence of the match ranging from 0.0 (completely uncertain) to 1.0 - // (completely certain). - float confidence = 2; -} - -// The call participant speaking for a given utterance. -message ConversationParticipant { - // The role of the participant. - enum Role { - // Participant's role is not set. - ROLE_UNSPECIFIED = 0; - - // Participant is a human agent. - HUMAN_AGENT = 1; - - // Participant is an automated agent. - AUTOMATED_AGENT = 2; - - // Participant is an end user who conversed with the contact center. - END_USER = 3; - - // Participant is either a human or automated agent. - ANY_AGENT = 4; - } - - oneof participant { - // The name of the participant provided by Dialogflow. Format: - // projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} - string dialogflow_participant_name = 5 [(google.api.resource_reference) = { - type: "dialogflow.googleapis.com/Participant" - }]; - - // A user-specified ID representing the participant. - string user_id = 6; - } - - // Deprecated. Use `dialogflow_participant_name` instead. - // The name of the Dialogflow participant. Format: - // projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant} - string dialogflow_participant = 1 [deprecated = true]; - - // Obfuscated user ID from Dialogflow. - string obfuscated_external_user_id = 3; - - // The role of the participant. - Role role = 2; -} - -// The View resource. -message View { - option (google.api.resource) = { - type: "contactcenterinsights.googleapis.com/View" - pattern: "projects/{project}/locations/{location}/views/{view}" - }; - - // Immutable. The resource name of the view. - // Format: - // projects/{project}/locations/{location}/views/{view} - string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // The human-readable display name of the view. - string display_name = 2; - - // Output only. The time at which this view was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The most recent time at which the view was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // String with specific view properties. - string value = 5; -} - -// Selector of all available annotators and phrase matchers to run. -message AnnotatorSelector { - // Whether to run the interruption annotator. - bool run_interruption_annotator = 1; - - // Whether to run the silence annotator. - bool run_silence_annotator = 2; - - // Whether to run the active phrase matcher annotator(s). - bool run_phrase_matcher_annotator = 3; - - // The list of phrase matchers to run. If not provided, all active phrase - // matchers will be used. If inactive phrase matchers are provided, they will - // not be used. Phrase matchers will be run only if - // run_phrase_matcher_annotator is set to true. Format: - // projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher} - repeated string phrase_matchers = 4 [(google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/PhraseMatcher" - }]; - - // Whether to run the sentiment annotator. - bool run_sentiment_annotator = 5; - - // Whether to run the entity annotator. - bool run_entity_annotator = 6; - - // Whether to run the intent annotator. - bool run_intent_annotator = 7; - - // Whether to run the issue model annotator. A model should have already been - // deployed for this to take effect. - bool run_issue_model_annotator = 8; - - // The issue model to run. If not provided, the most recently deployed topic - // model will be used. The provided issue model will only be used for - // inference if the issue model is deployed and if run_issue_model_annotator - // is set to true. If more than one issue model is provided, only the first - // provided issue model will be used for inference. - repeated string issue_models = 10 [(google.api.resource_reference) = { - type: "contactcenterinsights.googleapis.com/IssueModel" - }]; -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js deleted file mode 100644 index c672863a42b..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(issueModel) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource name of the issue model to query against. - */ - // const issueModel = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCalculateIssueModelStats() { - // Construct request - const request = { - issueModel, - }; - - // Run request - const response = await contactcenterinsightsClient.calculateIssueModelStats(request); - console.log(response); - } - - callCalculateIssueModelStats(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js deleted file mode 100644 index 8935fc364ac..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.calculate_stats.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(location) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location of the conversations. - */ - // const location = 'abc123' - /** - * A filter to reduce results to a specific subset. This field is useful for - * getting statistics about conversations with specific properties. - */ - // const filter = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCalculateStats() { - // Construct request - const request = { - location, - }; - - // Run request - const response = await contactcenterinsightsClient.calculateStats(request); - console.log(response); - } - - callCalculateStats(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js deleted file mode 100644 index 679fe549909..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_analysis.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, analysis) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the analysis. - */ - // const parent = 'abc123' - /** - * Required. The analysis to create. - */ - // const analysis = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCreateAnalysis() { - // Construct request - const request = { - parent, - analysis, - }; - - // Run request - const [operation] = await contactcenterinsightsClient.createAnalysis(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateAnalysis(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js deleted file mode 100644 index 92ff6b7db32..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_conversation.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, conversation) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the conversation. - */ - // const parent = 'abc123' - /** - * Required. The conversation resource to create. - */ - // const conversation = {} - /** - * A unique ID for the new conversation. This ID will become the final - * component of the conversation's resource name. If no ID is specified, a - * server-generated ID will be used. - * This value should be 4-64 characters and must match the regular - * expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-` - */ - // const conversationId = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCreateConversation() { - // Construct request - const request = { - parent, - conversation, - }; - - // Run request - const response = await contactcenterinsightsClient.createConversation(request); - console.log(response); - } - - callCreateConversation(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js deleted file mode 100644 index 5dbcb70672f..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_issue_model.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, issueModel) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the issue model. - */ - // const parent = 'abc123' - /** - * Required. The issue model to create. - */ - // const issueModel = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCreateIssueModel() { - // Construct request - const request = { - parent, - issueModel, - }; - - // Run request - const [operation] = await contactcenterinsightsClient.createIssueModel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateIssueModel(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js deleted file mode 100644 index 0564e15f0c7..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_phrase_matcher.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, phraseMatcher) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the phrase matcher. Required. The location to create - * a phrase matcher for. - * Format: `projects//locations/` or - * `projects//locations/` - */ - // const parent = 'abc123' - /** - * Required. The phrase matcher resource to create. - */ - // const phraseMatcher = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCreatePhraseMatcher() { - // Construct request - const request = { - parent, - phraseMatcher, - }; - - // Run request - const response = await contactcenterinsightsClient.createPhraseMatcher(request); - console.log(response); - } - - callCreatePhraseMatcher(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js deleted file mode 100644 index 6faa48a506f..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.create_view.js +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, view) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the view. Required. The location to create - * a view for. - * Format: `projects//locations/` or - * `projects//locations/` - */ - // const parent = 'abc123' - /** - * Required. The view resource to create. - */ - // const view = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callCreateView() { - // Construct request - const request = { - parent, - view, - }; - - // Run request - const response = await contactcenterinsightsClient.createView(request); - console.log(response); - } - - callCreateView(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js deleted file mode 100644 index 1608d0b6918..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_analysis.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the analysis to delete. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callDeleteAnalysis() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.deleteAnalysis(request); - console.log(response); - } - - callDeleteAnalysis(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js deleted file mode 100644 index 6afcbbccd01..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_conversation.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the conversation to delete. - */ - // const name = 'abc123' - /** - * If set to true, all of this conversation's analyses will also be deleted. - * Otherwise, the request will only succeed if the conversation has no - * analyses. - */ - // const force = true - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callDeleteConversation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.deleteConversation(request); - console.log(response); - } - - callDeleteConversation(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js deleted file mode 100644 index 1c193bf1d0c..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue_model.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the issue model to delete. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callDeleteIssueModel() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await contactcenterinsightsClient.deleteIssueModel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteIssueModel(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js deleted file mode 100644 index da8bb0ea342..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the phrase matcher to delete. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callDeletePhraseMatcher() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.deletePhraseMatcher(request); - console.log(response); - } - - callDeletePhraseMatcher(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js deleted file mode 100644 index f16c9572571..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_view.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the view to delete. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callDeleteView() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.deleteView(request); - console.log(response); - } - - callDeleteView(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js deleted file mode 100644 index 720266cc2d1..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.deploy_issue_model.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The issue model to deploy. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callDeployIssueModel() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await contactcenterinsightsClient.deployIssueModel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeployIssueModel(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js deleted file mode 100644 index a217af60a77..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.export_insights_data.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Specified if sink is a BigQuery table. - */ - // const bigQueryDestination = {} - /** - * Required. The parent resource to export data from. - */ - // const parent = 'abc123' - /** - * A filter to reduce results to a specific subset. Useful for exporting - * conversations with specific properties. - */ - // const filter = 'abc123' - /** - * A fully qualified KMS key name for BigQuery tables protected by CMEK. - * Format: - * projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version} - */ - // const kmsKey = 'abc123' - /** - * Options for what to do if the destination table already exists. - */ - // const writeDisposition = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callExportInsightsData() { - // Construct request - const request = { - parent, - }; - - // Run request - const [operation] = await contactcenterinsightsClient.exportInsightsData(request); - const [response] = await operation.promise(); - console.log(response); - } - - callExportInsightsData(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js deleted file mode 100644 index 9352b396b22..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_analysis.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the analysis to get. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetAnalysis() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getAnalysis(request); - console.log(response); - } - - callGetAnalysis(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js deleted file mode 100644 index 4c33825e6b3..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_conversation.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the conversation to get. - */ - // const name = 'abc123' - /** - * The level of details of the conversation. Default is `FULL`. - */ - // const view = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetConversation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getConversation(request); - console.log(response); - } - - callGetConversation(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js deleted file mode 100644 index 1862cc15195..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the issue to get. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetIssue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getIssue(request); - console.log(response); - } - - callGetIssue(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js deleted file mode 100644 index 014e48e8c94..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_issue_model.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the issue model to get. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetIssueModel() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getIssueModel(request); - console.log(response); - } - - callGetIssueModel(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js deleted file mode 100644 index 07419bb40b3..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_phrase_matcher.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the phrase matcher to get. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetPhraseMatcher() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getPhraseMatcher(request); - console.log(response); - } - - callGetPhraseMatcher(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js deleted file mode 100644 index 4819fa4c657..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_settings.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the settings resource to get. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getSettings(request); - console.log(response); - } - - callGetSettings(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js deleted file mode 100644 index 5e332347813..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.get_view.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the view to get. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callGetView() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await contactcenterinsightsClient.getView(request); - console.log(response); - } - - callGetView(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js deleted file mode 100644 index 951d859cb28..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_analyses.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the analyses. - */ - // const parent = 'abc123' - /** - * The maximum number of analyses to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - */ - // const pageSize = 1234 - /** - * The value returned by the last `ListAnalysesResponse`; indicates - * that this is a continuation of a prior `ListAnalyses` call and - * the system should return the next page of data. - */ - // const pageToken = 'abc123' - /** - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - */ - // const filter = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callListAnalyses() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await contactcenterinsightsClient.listAnalysesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAnalyses(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js deleted file mode 100644 index a7328a9ea27..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_conversations.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the conversation. - */ - // const parent = 'abc123' - /** - * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or - * unspecified, a default page size of 100 will be chosen. Note that a call - * might return fewer results than the requested page size. - */ - // const pageSize = 1234 - /** - * The value returned by the last `ListConversationsResponse`. This value - * indicates that this is a continuation of a prior `ListConversations` call - * and that the system should return the next page of data. - */ - // const pageToken = 'abc123' - /** - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - */ - // const filter = 'abc123' - /** - * The level of details of the conversation. Default is `BASIC`. - */ - // const view = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callListConversations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await contactcenterinsightsClient.listConversationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListConversations(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js deleted file mode 100644 index c493e90cd97..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issue_models.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the issue model. - */ - // const parent = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callListIssueModels() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await contactcenterinsightsClient.listIssueModels(request); - console.log(response); - } - - callListIssueModels(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js deleted file mode 100644 index 3dd60cb31e7..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_issues.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the issue. - */ - // const parent = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callListIssues() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await contactcenterinsightsClient.listIssues(request); - console.log(response); - } - - callListIssues(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js deleted file mode 100644 index d18d56dabe7..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_phrase_matchers.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the phrase matcher. - */ - // const parent = 'abc123' - /** - * The maximum number of phrase matchers to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - */ - // const pageSize = 1234 - /** - * The value returned by the last `ListPhraseMatchersResponse`. This value - * indicates that this is a continuation of a prior `ListPhraseMatchers` call - * and that the system should return the next page of data. - */ - // const pageToken = 'abc123' - /** - * A filter to reduce results to a specific subset. Useful for querying - * phrase matchers with specific properties. - */ - // const filter = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callListPhraseMatchers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await contactcenterinsightsClient.listPhraseMatchersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListPhraseMatchers(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js deleted file mode 100644 index b01eabb3c9a..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.list_views.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the views. - */ - // const parent = 'abc123' - /** - * The maximum number of views to return in the response. If this - * value is zero, the service will select a default size. A call may return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - */ - // const pageSize = 1234 - /** - * The value returned by the last `ListViewsResponse`; indicates - * that this is a continuation of a prior `ListViews` call and - * the system should return the next page of data. - */ - // const pageToken = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callListViews() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await contactcenterinsightsClient.listViewsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListViews(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js deleted file mode 100644 index 8ec02172b6b..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.undeploy_issue_model.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The issue model to undeploy. - */ - // const name = 'abc123' - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUndeployIssueModel() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await contactcenterinsightsClient.undeployIssueModel(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUndeployIssueModel(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js deleted file mode 100644 index 53be2c18b81..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_conversation.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(conversation) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new values for the conversation. - */ - // const conversation = {} - /** - * The list of fields to be updated. - */ - // const updateMask = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUpdateConversation() { - // Construct request - const request = { - conversation, - }; - - // Run request - const response = await contactcenterinsightsClient.updateConversation(request); - console.log(response); - } - - callUpdateConversation(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js deleted file mode 100644 index e01afb85cc8..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(issue) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new values for the issue. - */ - // const issue = {} - /** - * The list of fields to be updated. - */ - // const updateMask = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUpdateIssue() { - // Construct request - const request = { - issue, - }; - - // Run request - const response = await contactcenterinsightsClient.updateIssue(request); - console.log(response); - } - - callUpdateIssue(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js deleted file mode 100644 index 13e04b841c2..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_issue_model.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(issueModel) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new values for the issue model. - */ - // const issueModel = {} - /** - * The list of fields to be updated. - */ - // const updateMask = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUpdateIssueModel() { - // Construct request - const request = { - issueModel, - }; - - // Run request - const response = await contactcenterinsightsClient.updateIssueModel(request); - console.log(response); - } - - callUpdateIssueModel(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js deleted file mode 100644 index b33b4cc0115..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_phrase_matcher.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(phraseMatcher) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new values for the phrase matcher. - */ - // const phraseMatcher = {} - /** - * The list of fields to be updated. - */ - // const updateMask = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUpdatePhraseMatcher() { - // Construct request - const request = { - phraseMatcher, - }; - - // Run request - const response = await contactcenterinsightsClient.updatePhraseMatcher(request); - console.log(response); - } - - callUpdatePhraseMatcher(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js deleted file mode 100644 index f64596152fe..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_settings.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(settings, updateMask) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new settings values. - */ - // const settings = {} - /** - * Required. The list of fields to be updated. - */ - // const updateMask = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUpdateSettings() { - // Construct request - const request = { - settings, - updateMask, - }; - - // Run request - const response = await contactcenterinsightsClient.updateSettings(request); - console.log(response); - } - - callUpdateSettings(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js deleted file mode 100644 index 809e22badf4..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.update_view.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(view) { - // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The new view. - */ - // const view = {} - /** - * The list of fields to be updated. - */ - // const updateMask = {} - - // Imports the Contactcenterinsights library - const {ContactCenterInsightsClient} = require('@google-cloud/contact-center-insights').v1; - - // Instantiates a client - const contactcenterinsightsClient = new ContactCenterInsightsClient(); - - async function callUpdateView() { - // Construct request - const request = { - view, - }; - - // Run request - const response = await contactcenterinsightsClient.updateView(request); - console.log(response); - } - - callUpdateView(); - // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json deleted file mode 100644 index a8c3b679304..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json +++ /dev/null @@ -1,1643 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-contactcenterinsights", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.contactcenterinsights.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async", - "title": "ContactCenterInsights createConversation Sample", - "origin": "API_DEFINITION", - "description": " Creates a conversation.", - "canonical": true, - "file": "contact_center_insights.create_conversation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateConversation", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "conversation", - "type": ".google.cloud.contactcenterinsights.v1.Conversation" - }, - { - "name": "conversation_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Conversation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CreateConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateConversation", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async", - "title": "ContactCenterInsights updateConversation Sample", - "origin": "API_DEFINITION", - "description": " Updates a conversation.", - "canonical": true, - "file": "contact_center_insights.update_conversation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateConversation", - "async": true, - "parameters": [ - { - "name": "conversation", - "type": ".google.cloud.contactcenterinsights.v1.Conversation" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Conversation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UpdateConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateConversation", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async", - "title": "ContactCenterInsights getConversation Sample", - "origin": "API_DEFINITION", - "description": " Gets a conversation.", - "canonical": true, - "file": "contact_center_insights.get_conversation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetConversation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.contactcenterinsights.v1.ConversationView" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Conversation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetConversation", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async", - "title": "ContactCenterInsights listConversations Sample", - "origin": "API_DEFINITION", - "description": " Lists conversations.", - "canonical": true, - "file": "contact_center_insights.list_conversations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListConversations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListConversations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.contactcenterinsights.v1.ConversationView" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.ListConversationsResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ListConversations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListConversations", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async", - "title": "ContactCenterInsights deleteConversation Sample", - "origin": "API_DEFINITION", - "description": " Deletes a conversation.", - "canonical": true, - "file": "contact_center_insights.delete_conversation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteConversation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeleteConversation", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteConversation", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async", - "title": "ContactCenterInsights createAnalysis Sample", - "origin": "API_DEFINITION", - "description": " Creates an analysis. The long running operation is done when the analysis has completed.", - "canonical": true, - "file": "contact_center_insights.create_analysis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAnalysis", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateAnalysis", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "analysis", - "type": ".google.cloud.contactcenterinsights.v1.Analysis" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CreateAnalysis", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateAnalysis", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async", - "title": "ContactCenterInsights getAnalysis Sample", - "origin": "API_DEFINITION", - "description": " Gets an analysis.", - "canonical": true, - "file": "contact_center_insights.get_analysis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAnalysis", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetAnalysis", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Analysis", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetAnalysis", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetAnalysis", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async", - "title": "ContactCenterInsights listAnalyses Sample", - "origin": "API_DEFINITION", - "description": " Lists analyses.", - "canonical": true, - "file": "contact_center_insights.list_analyses.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAnalyses", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListAnalyses", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.ListAnalysesResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ListAnalyses", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListAnalyses", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async", - "title": "ContactCenterInsights deleteAnalysis Sample", - "origin": "API_DEFINITION", - "description": " Deletes an analysis.", - "canonical": true, - "file": "contact_center_insights.delete_analysis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAnalysis", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteAnalysis", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeleteAnalysis", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteAnalysis", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async", - "title": "ContactCenterInsights bulkAnalyzeConversations Sample", - "origin": "API_DEFINITION", - "description": " Analyzes multiple conversations in a single request.", - "canonical": true, - "file": "contact_center_insights.bulk_analyze_conversations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BulkAnalyzeConversations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "analysis_percentage", - "type": "TYPE_FLOAT" - }, - { - "name": "annotator_selector", - "type": ".google.cloud.contactcenterinsights.v1.AnnotatorSelector" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "BulkAnalyzeConversations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversations", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async", - "title": "ContactCenterInsights ingestConversations Sample", - "origin": "API_DEFINITION", - "description": " Imports conversations and processes them according to the user's configuration.", - "canonical": true, - "file": "contact_center_insights.ingest_conversations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "IngestConversations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversations", - "async": true, - "parameters": [ - { - "name": "gcs_source", - "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource" - }, - { - "name": "transcript_object_config", - "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "conversation_config", - "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "IngestConversations", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversations", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async", - "title": "ContactCenterInsights exportInsightsData Sample", - "origin": "API_DEFINITION", - "description": " Export insights data to a destination defined in the request body.", - "canonical": true, - "file": "contact_center_insights.export_insights_data.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ExportInsightsData", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ExportInsightsData", - "async": true, - "parameters": [ - { - "name": "big_query_destination", - "type": ".google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.BigQueryDestination" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "kms_key", - "type": "TYPE_STRING" - }, - { - "name": "write_disposition", - "type": ".google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.WriteDisposition" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ExportInsightsData", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ExportInsightsData", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async", - "title": "ContactCenterInsights createIssueModel Sample", - "origin": "API_DEFINITION", - "description": " Creates an issue model.", - "canonical": true, - "file": "contact_center_insights.create_issue_model.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateIssueModel", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "issue_model", - "type": ".google.cloud.contactcenterinsights.v1.IssueModel" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CreateIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateIssueModel", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async", - "title": "ContactCenterInsights updateIssueModel Sample", - "origin": "API_DEFINITION", - "description": " Updates an issue model.", - "canonical": true, - "file": "contact_center_insights.update_issue_model.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssueModel", - "async": true, - "parameters": [ - { - "name": "issue_model", - "type": ".google.cloud.contactcenterinsights.v1.IssueModel" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.IssueModel", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UpdateIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssueModel", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async", - "title": "ContactCenterInsights getIssueModel Sample", - "origin": "API_DEFINITION", - "description": " Gets an issue model.", - "canonical": true, - "file": "contact_center_insights.get_issue_model.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssueModel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.IssueModel", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssueModel", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async", - "title": "ContactCenterInsights listIssueModels Sample", - "origin": "API_DEFINITION", - "description": " Lists issue models.", - "canonical": true, - "file": "contact_center_insights.list_issue_models.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListIssueModels", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssueModels", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.ListIssueModelsResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ListIssueModels", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssueModels", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async", - "title": "ContactCenterInsights deleteIssueModel Sample", - "origin": "API_DEFINITION", - "description": " Deletes an issue model.", - "canonical": true, - "file": "contact_center_insights.delete_issue_model.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueModel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeleteIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueModel", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async", - "title": "ContactCenterInsights deployIssueModel Sample", - "origin": "API_DEFINITION", - "description": " Deploys an issue model. Returns an error if a model is already deployed. An issue model can only be used in analysis after it has been deployed.", - "canonical": true, - "file": "contact_center_insights.deploy_issue_model.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeployIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeployIssueModel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeployIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeployIssueModel", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async", - "title": "ContactCenterInsights undeployIssueModel Sample", - "origin": "API_DEFINITION", - "description": " Undeploys an issue model. An issue model can not be used in analysis after it has been undeployed.", - "canonical": true, - "file": "contact_center_insights.undeploy_issue_model.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UndeployIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UndeployIssueModel", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UndeployIssueModel", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UndeployIssueModel", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async", - "title": "ContactCenterInsights getIssue Sample", - "origin": "API_DEFINITION", - "description": " Gets an issue.", - "canonical": true, - "file": "contact_center_insights.get_issue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIssue", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Issue", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetIssue", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetIssue", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async", - "title": "ContactCenterInsights listIssues Sample", - "origin": "API_DEFINITION", - "description": " Lists issues.", - "canonical": true, - "file": "contact_center_insights.list_issues.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListIssues", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssues", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.ListIssuesResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ListIssues", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListIssues", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async", - "title": "ContactCenterInsights updateIssue Sample", - "origin": "API_DEFINITION", - "description": " Updates an issue.", - "canonical": true, - "file": "contact_center_insights.update_issue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateIssue", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssue", - "async": true, - "parameters": [ - { - "name": "issue", - "type": ".google.cloud.contactcenterinsights.v1.Issue" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Issue", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UpdateIssue", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateIssue", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async", - "title": "ContactCenterInsights deleteIssue Sample", - "origin": "API_DEFINITION", - "description": " Deletes an issue.", - "canonical": true, - "file": "contact_center_insights.delete_issue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteIssue", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeleteIssue", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssue", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async", - "title": "ContactCenterInsights calculateIssueModelStats Sample", - "origin": "API_DEFINITION", - "description": " Gets an issue model's statistics.", - "canonical": true, - "file": "contact_center_insights.calculate_issue_model_stats.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CalculateIssueModelStats", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateIssueModelStats", - "async": true, - "parameters": [ - { - "name": "issue_model", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CalculateIssueModelStats", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateIssueModelStats", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async", - "title": "ContactCenterInsights createPhraseMatcher Sample", - "origin": "API_DEFINITION", - "description": " Creates a phrase matcher.", - "canonical": true, - "file": "contact_center_insights.create_phrase_matcher.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreatePhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreatePhraseMatcher", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "phrase_matcher", - "type": ".google.cloud.contactcenterinsights.v1.PhraseMatcher" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.PhraseMatcher", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CreatePhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreatePhraseMatcher", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async", - "title": "ContactCenterInsights getPhraseMatcher Sample", - "origin": "API_DEFINITION", - "description": " Gets a phrase matcher.", - "canonical": true, - "file": "contact_center_insights.get_phrase_matcher.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetPhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetPhraseMatcher", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.PhraseMatcher", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetPhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetPhraseMatcher", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async", - "title": "ContactCenterInsights listPhraseMatchers Sample", - "origin": "API_DEFINITION", - "description": " Lists phrase matchers.", - "canonical": true, - "file": "contact_center_insights.list_phrase_matchers.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListPhraseMatchers", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListPhraseMatchers", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.ListPhraseMatchersResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ListPhraseMatchers", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListPhraseMatchers", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async", - "title": "ContactCenterInsights deletePhraseMatcher Sample", - "origin": "API_DEFINITION", - "description": " Deletes a phrase matcher.", - "canonical": true, - "file": "contact_center_insights.delete_phrase_matcher.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeletePhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeletePhraseMatcher", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeletePhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeletePhraseMatcher", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async", - "title": "ContactCenterInsights updatePhraseMatcher Sample", - "origin": "API_DEFINITION", - "description": " Updates a phrase matcher.", - "canonical": true, - "file": "contact_center_insights.update_phrase_matcher.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdatePhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdatePhraseMatcher", - "async": true, - "parameters": [ - { - "name": "phrase_matcher", - "type": ".google.cloud.contactcenterinsights.v1.PhraseMatcher" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.PhraseMatcher", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UpdatePhraseMatcher", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdatePhraseMatcher", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async", - "title": "ContactCenterInsights calculateStats Sample", - "origin": "API_DEFINITION", - "description": " Gets conversation statistics.", - "canonical": true, - "file": "contact_center_insights.calculate_stats.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CalculateStats", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateStats", - "async": true, - "parameters": [ - { - "name": "location", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.CalculateStatsResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CalculateStats", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CalculateStats", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async", - "title": "ContactCenterInsights getSettings Sample", - "origin": "API_DEFINITION", - "description": " Gets project-level settings.", - "canonical": true, - "file": "contact_center_insights.get_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSettings", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Settings", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetSettings", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetSettings", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async", - "title": "ContactCenterInsights updateSettings Sample", - "origin": "API_DEFINITION", - "description": " Updates project-level settings.", - "canonical": true, - "file": "contact_center_insights.update_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSettings", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateSettings", - "async": true, - "parameters": [ - { - "name": "settings", - "type": ".google.cloud.contactcenterinsights.v1.Settings" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.Settings", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UpdateSettings", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateSettings", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async", - "title": "ContactCenterInsights createView Sample", - "origin": "API_DEFINITION", - "description": " Creates a view.", - "canonical": true, - "file": "contact_center_insights.create_view.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateView", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.contactcenterinsights.v1.View" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.View", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "CreateView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.CreateView", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async", - "title": "ContactCenterInsights getView Sample", - "origin": "API_DEFINITION", - "description": " Gets a view.", - "canonical": true, - "file": "contact_center_insights.get_view.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetView", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.View", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "GetView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.GetView", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async", - "title": "ContactCenterInsights listViews Sample", - "origin": "API_DEFINITION", - "description": " Lists views.", - "canonical": true, - "file": "contact_center_insights.list_views.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListViews", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListViews", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.ListViewsResponse", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "ListViews", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.ListViews", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async", - "title": "ContactCenterInsights updateView Sample", - "origin": "API_DEFINITION", - "description": " Updates a view.", - "canonical": true, - "file": "contact_center_insights.update_view.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateView", - "async": true, - "parameters": [ - { - "name": "view", - "type": ".google.cloud.contactcenterinsights.v1.View" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.contactcenterinsights.v1.View", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "UpdateView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.UpdateView", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - }, - { - "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async", - "title": "ContactCenterInsights deleteView Sample", - "origin": "API_DEFINITION", - "description": " Deletes a view.", - "canonical": true, - "file": "contact_center_insights.delete_view.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteView", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ContactCenterInsightsClient", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" - }, - "method": { - "shortName": "DeleteView", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteView", - "service": { - "shortName": "ContactCenterInsights", - "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts deleted file mode 100644 index 7b7df987f41..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const ContactCenterInsightsClient = v1.ContactCenterInsightsClient; -type ContactCenterInsightsClient = v1.ContactCenterInsightsClient; -export {v1, ContactCenterInsightsClient}; -export default {v1, ContactCenterInsightsClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts deleted file mode 100644 index 83c5efe9951..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client.ts +++ /dev/null @@ -1,4370 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/contact_center_insights_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './contact_center_insights_client_config.json'; -const version = require('../../../package.json').version; - -/** - * An API that lets users analyze and explore their business conversation data. - * @class - * @memberof v1 - */ -export class ContactCenterInsightsClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - contactCenterInsightsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ContactCenterInsightsClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ContactCenterInsightsClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ContactCenterInsightsClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - analysisPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}' - ), - conversationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/conversations/{conversation}' - ), - issuePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/issueModels/{issue_model}/issues/{issue}' - ), - issueModelPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/issueModels/{issue_model}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - phraseMatcherPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}' - ), - settingsPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/settings' - ), - viewPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/views/{view}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listConversations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'conversations'), - listAnalyses: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'analyses'), - listPhraseMatchers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'phraseMatchers'), - listViews: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'views') - }; - - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createAnalysisResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.Analysis') as gax.protobuf.Type; - const createAnalysisMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata') as gax.protobuf.Type; - const bulkAnalyzeConversationsResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse') as gax.protobuf.Type; - const bulkAnalyzeConversationsMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata') as gax.protobuf.Type; - const ingestConversationsResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.IngestConversationsResponse') as gax.protobuf.Type; - const ingestConversationsMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata') as gax.protobuf.Type; - const exportInsightsDataResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse') as gax.protobuf.Type; - const exportInsightsDataMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.ExportInsightsDataMetadata') as gax.protobuf.Type; - const createIssueModelResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.IssueModel') as gax.protobuf.Type; - const createIssueModelMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.CreateIssueModelMetadata') as gax.protobuf.Type; - const deleteIssueModelResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteIssueModelMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.DeleteIssueModelMetadata') as gax.protobuf.Type; - const deployIssueModelResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.DeployIssueModelResponse') as gax.protobuf.Type; - const deployIssueModelMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.DeployIssueModelMetadata') as gax.protobuf.Type; - const undeployIssueModelResponse = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.UndeployIssueModelResponse') as gax.protobuf.Type; - const undeployIssueModelMetadata = protoFilesRoot.lookup( - '.google.cloud.contactcenterinsights.v1.UndeployIssueModelMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createAnalysis: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createAnalysisResponse.decode.bind(createAnalysisResponse), - createAnalysisMetadata.decode.bind(createAnalysisMetadata)), - bulkAnalyzeConversations: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - bulkAnalyzeConversationsResponse.decode.bind(bulkAnalyzeConversationsResponse), - bulkAnalyzeConversationsMetadata.decode.bind(bulkAnalyzeConversationsMetadata)), - ingestConversations: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - ingestConversationsResponse.decode.bind(ingestConversationsResponse), - ingestConversationsMetadata.decode.bind(ingestConversationsMetadata)), - exportInsightsData: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportInsightsDataResponse.decode.bind(exportInsightsDataResponse), - exportInsightsDataMetadata.decode.bind(exportInsightsDataMetadata)), - createIssueModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createIssueModelResponse.decode.bind(createIssueModelResponse), - createIssueModelMetadata.decode.bind(createIssueModelMetadata)), - deleteIssueModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteIssueModelResponse.decode.bind(deleteIssueModelResponse), - deleteIssueModelMetadata.decode.bind(deleteIssueModelMetadata)), - deployIssueModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployIssueModelResponse.decode.bind(deployIssueModelResponse), - deployIssueModelMetadata.decode.bind(deployIssueModelMetadata)), - undeployIssueModel: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployIssueModelResponse.decode.bind(undeployIssueModelResponse), - undeployIssueModelMetadata.decode.bind(undeployIssueModelMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.contactcenterinsights.v1.ContactCenterInsights', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.contactCenterInsightsStub) { - return this.contactCenterInsightsStub; - } - - // Put together the "service stub" for - // google.cloud.contactcenterinsights.v1.ContactCenterInsights. - this.contactCenterInsightsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.contactcenterinsights.v1.ContactCenterInsights') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.contactcenterinsights.v1.ContactCenterInsights, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const contactCenterInsightsStubMethods = - ['createConversation', 'updateConversation', 'getConversation', 'listConversations', 'deleteConversation', 'createAnalysis', 'getAnalysis', 'listAnalyses', 'deleteAnalysis', 'bulkAnalyzeConversations', 'ingestConversations', 'exportInsightsData', 'createIssueModel', 'updateIssueModel', 'getIssueModel', 'listIssueModels', 'deleteIssueModel', 'deployIssueModel', 'undeployIssueModel', 'getIssue', 'listIssues', 'updateIssue', 'deleteIssue', 'calculateIssueModelStats', 'createPhraseMatcher', 'getPhraseMatcher', 'listPhraseMatchers', 'deletePhraseMatcher', 'updatePhraseMatcher', 'calculateStats', 'getSettings', 'updateSettings', 'createView', 'getView', 'listViews', 'updateView', 'deleteView']; - for (const methodName of contactCenterInsightsStubMethods) { - const callPromise = this.contactCenterInsightsStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.contactCenterInsightsStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'contactcenterinsights.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'contactcenterinsights.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Creates a conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the conversation. - * @param {google.cloud.contactcenterinsights.v1.Conversation} request.conversation - * Required. The conversation resource to create. - * @param {string} request.conversationId - * A unique ID for the new conversation. This ID will become the final - * component of the conversation's resource name. If no ID is specified, a - * server-generated ID will be used. - * - * This value should be 4-64 characters and must match the regular - * expression `^{@link 0-9|a-z0-9-]{4,64}$`. Valid characters are `[a-z}-` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_conversation.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_async - */ - createConversation( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|undefined, {}|undefined - ]>; - createConversation( - request: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, - {}|null|undefined>): void; - createConversation( - request: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, - {}|null|undefined>): void; - createConversation( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.ICreateConversationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createConversation(request, options, callback); - } -/** - * Updates a conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.Conversation} request.conversation - * Required. The new values for the conversation. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.update_conversation.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_async - */ - updateConversation( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|undefined, {}|undefined - ]>; - updateConversation( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, - {}|null|undefined>): void; - updateConversation( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, - {}|null|undefined>): void; - updateConversation( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IUpdateConversationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'conversation.name': request.conversation!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateConversation(request, options, callback); - } -/** - * Gets a conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversation to get. - * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view - * The level of details of the conversation. Default is `FULL`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_conversation.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_async - */ - getConversation( - request?: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|undefined, {}|undefined - ]>; - getConversation( - request: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>): void; - getConversation( - request: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>): void; - getConversation( - request?: protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation, - protos.google.cloud.contactcenterinsights.v1.IGetConversationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getConversation(request, options, callback); - } -/** - * Deletes a conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversation to delete. - * @param {boolean} request.force - * If set to true, all of this conversation's analyses will also be deleted. - * Otherwise, the request will only succeed if the conversation has no - * analyses. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_conversation.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_async - */ - deleteConversation( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|undefined, {}|undefined - ]>; - deleteConversation( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>): void; - deleteConversation( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>): void; - deleteConversation( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteConversationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteConversation(request, options, callback); - } -/** - * Gets an analysis. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the analysis to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_analysis.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_async - */ - getAnalysis( - request?: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IAnalysis, - protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|undefined, {}|undefined - ]>; - getAnalysis( - request: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IAnalysis, - protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, - {}|null|undefined>): void; - getAnalysis( - request: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IAnalysis, - protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, - {}|null|undefined>): void; - getAnalysis( - request?: protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IAnalysis, - protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IAnalysis, - protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IAnalysis, - protos.google.cloud.contactcenterinsights.v1.IGetAnalysisRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getAnalysis(request, options, callback); - } -/** - * Deletes an analysis. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the analysis to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_analysis.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_async - */ - deleteAnalysis( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|undefined, {}|undefined - ]>; - deleteAnalysis( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, - {}|null|undefined>): void; - deleteAnalysis( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, - {}|null|undefined>): void; - deleteAnalysis( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteAnalysis(request, options, callback); - } -/** - * Updates an issue model. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.IssueModel} request.issueModel - * Required. The new values for the issue model. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [IssueModel]{@link google.cloud.contactcenterinsights.v1.IssueModel}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.update_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_async - */ - updateIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|undefined, {}|undefined - ]>; - updateIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, - {}|null|undefined>): void; - updateIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, - {}|null|undefined>): void; - updateIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueModelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'issue_model.name': request.issueModel!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateIssueModel(request, options, callback); - } -/** - * Gets an issue model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the issue model to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [IssueModel]{@link google.cloud.contactcenterinsights.v1.IssueModel}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_async - */ - getIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|undefined, {}|undefined - ]>; - getIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, - {}|null|undefined>): void; - getIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, - {}|null|undefined>): void; - getIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssueModel, - protos.google.cloud.contactcenterinsights.v1.IGetIssueModelRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIssueModel(request, options, callback); - } -/** - * Lists issue models. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the issue model. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListIssueModelsResponse]{@link google.cloud.contactcenterinsights.v1.ListIssueModelsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.list_issue_models.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_async - */ - listIssueModels( - request?: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|undefined, {}|undefined - ]>; - listIssueModels( - request: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, - {}|null|undefined>): void; - listIssueModels( - request: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, - {}|null|undefined>): void; - listIssueModels( - request?: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssueModelsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listIssueModels(request, options, callback); - } -/** - * Gets an issue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the issue to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Issue]{@link google.cloud.contactcenterinsights.v1.Issue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_issue.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_async - */ - getIssue( - request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|undefined, {}|undefined - ]>; - getIssue( - request: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, - {}|null|undefined>): void; - getIssue( - request: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, - {}|null|undefined>): void; - getIssue( - request?: protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IGetIssueRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIssue(request, options, callback); - } -/** - * Lists issues. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the issue. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListIssuesResponse]{@link google.cloud.contactcenterinsights.v1.ListIssuesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.list_issues.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_async - */ - listIssues( - request?: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|undefined, {}|undefined - ]>; - listIssues( - request: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, - {}|null|undefined>): void; - listIssues( - request: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, - {}|null|undefined>): void; - listIssues( - request?: protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse, - protos.google.cloud.contactcenterinsights.v1.IListIssuesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listIssues(request, options, callback); - } -/** - * Updates an issue. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.Issue} request.issue - * Required. The new values for the issue. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Issue]{@link google.cloud.contactcenterinsights.v1.Issue}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.update_issue.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_async - */ - updateIssue( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|undefined, {}|undefined - ]>; - updateIssue( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, - {}|null|undefined>): void; - updateIssue( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, - {}|null|undefined>): void; - updateIssue( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IIssue, - protos.google.cloud.contactcenterinsights.v1.IUpdateIssueRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'issue.name': request.issue!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateIssue(request, options, callback); - } -/** - * Deletes an issue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the issue to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_issue.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async - */ - deleteIssue( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|undefined, {}|undefined - ]>; - deleteIssue( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, - {}|null|undefined>): void; - deleteIssue( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, - {}|null|undefined>): void; - deleteIssue( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteIssue(request, options, callback); - } -/** - * Gets an issue model's statistics. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.issueModel - * Required. The resource name of the issue model to query against. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CalculateIssueModelStatsResponse]{@link google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async - */ - calculateIssueModelStats( - request?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|undefined, {}|undefined - ]>; - calculateIssueModelStats( - request: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, - {}|null|undefined>): void; - calculateIssueModelStats( - request: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, - {}|null|undefined>): void; - calculateIssueModelStats( - request?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'issue_model': request.issueModel ?? '', - }); - this.initialize(); - return this.innerApiCalls.calculateIssueModelStats(request, options, callback); - } -/** - * Creates a phrase matcher. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the phrase matcher. Required. The location to create - * a phrase matcher for. - * Format: `projects//locations/` or - * `projects//locations/` - * @param {google.cloud.contactcenterinsights.v1.PhraseMatcher} request.phraseMatcher - * Required. The phrase matcher resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_phrase_matcher.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_async - */ - createPhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|undefined, {}|undefined - ]>; - createPhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - createPhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - createPhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.ICreatePhraseMatcherRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createPhraseMatcher(request, options, callback); - } -/** - * Gets a phrase matcher. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the phrase matcher to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_phrase_matcher.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_async - */ - getPhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|undefined, {}|undefined - ]>; - getPhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - getPhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - getPhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IGetPhraseMatcherRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getPhraseMatcher(request, options, callback); - } -/** - * Deletes a phrase matcher. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the phrase matcher to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_phrase_matcher.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_async - */ - deletePhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|undefined, {}|undefined - ]>; - deletePhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - deletePhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - deletePhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeletePhraseMatcherRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deletePhraseMatcher(request, options, callback); - } -/** - * Updates a phrase matcher. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.PhraseMatcher} request.phraseMatcher - * Required. The new values for the phrase matcher. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.update_phrase_matcher.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_async - */ - updatePhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|undefined, {}|undefined - ]>; - updatePhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - updatePhraseMatcher( - request: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, - {}|null|undefined>): void; - updatePhraseMatcher( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher, - protos.google.cloud.contactcenterinsights.v1.IUpdatePhraseMatcherRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'phrase_matcher.name': request.phraseMatcher!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updatePhraseMatcher(request, options, callback); - } -/** - * Gets conversation statistics. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.location - * Required. The location of the conversations. - * @param {string} request.filter - * A filter to reduce results to a specific subset. This field is useful for - * getting statistics about conversations with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CalculateStatsResponse]{@link google.cloud.contactcenterinsights.v1.CalculateStatsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.calculate_stats.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_async - */ - calculateStats( - request?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|undefined, {}|undefined - ]>; - calculateStats( - request: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, - {}|null|undefined>): void; - calculateStats( - request: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, - {}|null|undefined>): void; - calculateStats( - request?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse, - protos.google.cloud.contactcenterinsights.v1.ICalculateStatsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'location': request.location ?? '', - }); - this.initialize(); - return this.innerApiCalls.calculateStats(request, options, callback); - } -/** - * Gets project-level settings. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the settings resource to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Settings]{@link google.cloud.contactcenterinsights.v1.Settings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_settings.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_async - */ - getSettings( - request?: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|undefined, {}|undefined - ]>; - getSettings( - request: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, - {}|null|undefined>): void; - getSettings( - request: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, - {}|null|undefined>): void; - getSettings( - request?: protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IGetSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getSettings(request, options, callback); - } -/** - * Updates project-level settings. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.Settings} request.settings - * Required. The new settings values. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Settings]{@link google.cloud.contactcenterinsights.v1.Settings}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.update_settings.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_async - */ - updateSettings( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|undefined, {}|undefined - ]>; - updateSettings( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateSettings( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>): void; - updateSettings( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.ISettings, - protos.google.cloud.contactcenterinsights.v1.IUpdateSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'settings.name': request.settings!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateSettings(request, options, callback); - } -/** - * Creates a view. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the view. Required. The location to create - * a view for. - * Format: `projects//locations/` or - * `projects//locations/` - * @param {google.cloud.contactcenterinsights.v1.View} request.view - * Required. The view resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [View]{@link google.cloud.contactcenterinsights.v1.View}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_view.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_async - */ - createView( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|undefined, {}|undefined - ]>; - createView( - request: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, - {}|null|undefined>): void; - createView( - request: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, - {}|null|undefined>): void; - createView( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.ICreateViewRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createView(request, options, callback); - } -/** - * Gets a view. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the view to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [View]{@link google.cloud.contactcenterinsights.v1.View}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.get_view.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_GetView_async - */ - getView( - request?: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|undefined, {}|undefined - ]>; - getView( - request: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, - {}|null|undefined>): void; - getView( - request: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, - {}|null|undefined>): void; - getView( - request?: protos.google.cloud.contactcenterinsights.v1.IGetViewRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IGetViewRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getView(request, options, callback); - } -/** - * Updates a view. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.View} request.view - * Required. The new view. - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [View]{@link google.cloud.contactcenterinsights.v1.View}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.update_view.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_async - */ - updateView( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|undefined, {}|undefined - ]>; - updateView( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, - {}|null|undefined>): void; - updateView( - request: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, - callback: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, - {}|null|undefined>): void; - updateView( - request?: protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView, - protos.google.cloud.contactcenterinsights.v1.IUpdateViewRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'view.name': request.view!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateView(request, options, callback); - } -/** - * Deletes a view. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the view to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_view.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_async - */ - deleteView( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|undefined, {}|undefined - ]>; - deleteView( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, - {}|null|undefined>): void; - deleteView( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, - {}|null|undefined>): void; - deleteView( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.contactcenterinsights.v1.IDeleteViewRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteView(request, options, callback); - } - -/** - * Creates an analysis. The long running operation is done when the analysis - * has completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the analysis. - * @param {google.cloud.contactcenterinsights.v1.Analysis} request.analysis - * Required. The analysis to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_analysis.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async - */ - createAnalysis( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createAnalysis( - request: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createAnalysis( - request: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createAnalysis( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createAnalysis(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createAnalysis()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_analysis.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_async - */ - async checkCreateAnalysisProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAnalysis, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Analyzes multiple conversations in a single request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource to create analyses in. - * @param {string} request.filter - * Required. Filter used to select the subset of conversations to analyze. - * @param {number} request.analysisPercentage - * Required. Percentage of selected conversation to analyze, between - * [0, 100]. - * @param {google.cloud.contactcenterinsights.v1.AnnotatorSelector} request.annotatorSelector - * To select the annotators to run and the phrase matchers to use - * (if any). If not specified, all annotators will be run. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async - */ - bulkAnalyzeConversations( - request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - bulkAnalyzeConversations( - request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - bulkAnalyzeConversations( - request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - bulkAnalyzeConversations( - request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.bulkAnalyzeConversations(request, options, callback); - } -/** - * Check the status of the long running operation returned by `bulkAnalyzeConversations()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async - */ - async checkBulkAnalyzeConversationsProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.bulkAnalyzeConversations, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports conversations and processes them according to the user's - * configuration. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} request.gcsSource - * A cloud storage bucket source. - * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} request.transcriptObjectConfig - * Configuration for when `source` contains conversation transcripts. - * @param {string} request.parent - * Required. The parent resource for new conversations. - * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} request.conversationConfig - * Configuration that applies to all conversations. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.ingest_conversations.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async - */ - ingestConversations( - request?: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - ingestConversations( - request: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - ingestConversations( - request: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - ingestConversations( - request?: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.ingestConversations(request, options, callback); - } -/** - * Check the status of the long running operation returned by `ingestConversations()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.ingest_conversations.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async - */ - async checkIngestConversationsProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.ingestConversations, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Export insights data to a destination defined in the request body. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.BigQueryDestination} request.bigQueryDestination - * Specified if sink is a BigQuery table. - * @param {string} request.parent - * Required. The parent resource to export data from. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for exporting - * conversations with specific properties. - * @param {string} request.kmsKey - * A fully qualified KMS key name for BigQuery tables protected by CMEK. - * Format: - * projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version} - * @param {google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.WriteDisposition} request.writeDisposition - * Options for what to do if the destination table already exists. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.export_insights_data.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async - */ - exportInsightsData( - request?: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - exportInsightsData( - request: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportInsightsData( - request: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - exportInsightsData( - request?: protos.google.cloud.contactcenterinsights.v1.IExportInsightsDataRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.exportInsightsData(request, options, callback); - } -/** - * Check the status of the long running operation returned by `exportInsightsData()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.export_insights_data.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async - */ - async checkExportInsightsDataProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportInsightsData, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates an issue model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the issue model. - * @param {google.cloud.contactcenterinsights.v1.IssueModel} request.issueModel - * Required. The issue model to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async - */ - createIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.ICreateIssueModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createIssueModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createIssueModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.create_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_async - */ - async checkCreateIssueModelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIssueModel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes an issue model. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the issue model to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async - */ - deleteIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteIssueModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteIssueModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.delete_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_async - */ - async checkDeleteIssueModelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIssueModel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys an issue model. Returns an error if a model is already deployed. - * An issue model can only be used in analysis after it has been deployed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The issue model to deploy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.deploy_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async - */ - deployIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IDeployIssueModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deployIssueModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deployIssueModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.deploy_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_async - */ - async checkDeployIssueModelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployIssueModel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys an issue model. - * An issue model can not be used in analysis after it has been undeployed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The issue model to undeploy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.undeploy_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async - */ - undeployIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployIssueModel( - request: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployIssueModel( - request?: protos.google.cloud.contactcenterinsights.v1.IUndeployIssueModelRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.undeployIssueModel(request, options, callback); - } -/** - * Check the status of the long running operation returned by `undeployIssueModel()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.undeploy_issue_model.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_async - */ - async checkUndeployIssueModelProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployIssueModel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists conversations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the conversation. - * @param {number} request.pageSize - * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or - * unspecified, a default page size of 100 will be chosen. Note that a call - * might return fewer results than the requested page size. - * @param {string} request.pageToken - * The value returned by the last `ListConversationsResponse`. This value - * indicates that this is a continuation of a prior `ListConversations` call - * and that the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view - * The level of details of the conversation. Default is `BASIC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listConversationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listConversations( - request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation[], - protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse - ]>; - listConversations( - request: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IConversation>): void; - listConversations( - request: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IConversation>): void; - listConversations( - request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IConversation>, - callback?: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IConversation>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IConversation[], - protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListConversationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listConversations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the conversation. - * @param {number} request.pageSize - * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or - * unspecified, a default page size of 100 will be chosen. Note that a call - * might return fewer results than the requested page size. - * @param {string} request.pageToken - * The value returned by the last `ListConversationsResponse`. This value - * indicates that this is a continuation of a prior `ListConversations` call - * and that the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view - * The level of details of the conversation. Default is `BASIC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listConversationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listConversationsStream( - request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listConversations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConversations.createStream( - this.innerApiCalls.listConversations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listConversations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the conversation. - * @param {number} request.pageSize - * The maximum number of conversations to return in the response. A valid page - * size ranges from 0 to 1,000 inclusive. If the page size is zero or - * unspecified, a default page size of 100 will be chosen. Note that a call - * might return fewer results than the requested page size. - * @param {string} request.pageToken - * The value returned by the last `ListConversationsResponse`. This value - * indicates that this is a continuation of a prior `ListConversations` call - * and that the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - * @param {google.cloud.contactcenterinsights.v1.ConversationView} request.view - * The level of details of the conversation. Default is `BASIC`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Conversation]{@link google.cloud.contactcenterinsights.v1.Conversation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.list_conversations.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_async - */ - listConversationsAsync( - request?: protos.google.cloud.contactcenterinsights.v1.IListConversationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listConversations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listConversations.asyncIterate( - this.innerApiCalls['listConversations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists analyses. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the analyses. - * @param {number} request.pageSize - * The maximum number of analyses to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListAnalysesResponse`; indicates - * that this is a continuation of a prior `ListAnalyses` call and - * the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAnalysesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAnalyses( - request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IAnalysis[], - protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse - ]>; - listAnalyses( - request: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IAnalysis>): void; - listAnalyses( - request: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IAnalysis>): void; - listAnalyses( - request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IAnalysis>, - callback?: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IAnalysis>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IAnalysis[], - protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListAnalysesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listAnalyses(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the analyses. - * @param {number} request.pageSize - * The maximum number of analyses to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListAnalysesResponse`; indicates - * that this is a continuation of a prior `ListAnalyses` call and - * the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAnalysesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listAnalysesStream( - request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAnalyses']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAnalyses.createStream( - this.innerApiCalls.listAnalyses as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAnalyses`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the analyses. - * @param {number} request.pageSize - * The maximum number of analyses to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListAnalysesResponse`; indicates - * that this is a continuation of a prior `ListAnalyses` call and - * the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * conversations with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Analysis]{@link google.cloud.contactcenterinsights.v1.Analysis}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.list_analyses.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_async - */ - listAnalysesAsync( - request?: protos.google.cloud.contactcenterinsights.v1.IListAnalysesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAnalyses']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAnalyses.asyncIterate( - this.innerApiCalls['listAnalyses'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists phrase matchers. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the phrase matcher. - * @param {number} request.pageSize - * The maximum number of phrase matchers to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListPhraseMatchersResponse`. This value - * indicates that this is a continuation of a prior `ListPhraseMatchers` call - * and that the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * phrase matchers with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listPhraseMatchersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPhraseMatchers( - request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[], - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse - ]>; - listPhraseMatchers( - request: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>): void; - listPhraseMatchers( - request: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>): void; - listPhraseMatchers( - request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>, - callback?: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[], - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listPhraseMatchers(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the phrase matcher. - * @param {number} request.pageSize - * The maximum number of phrase matchers to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListPhraseMatchersResponse`. This value - * indicates that this is a continuation of a prior `ListPhraseMatchers` call - * and that the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * phrase matchers with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listPhraseMatchersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listPhraseMatchersStream( - request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listPhraseMatchers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPhraseMatchers.createStream( - this.innerApiCalls.listPhraseMatchers as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listPhraseMatchers`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the phrase matcher. - * @param {number} request.pageSize - * The maximum number of phrase matchers to return in the response. If this - * value is zero, the service will select a default size. A call might return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListPhraseMatchersResponse`. This value - * indicates that this is a continuation of a prior `ListPhraseMatchers` call - * and that the system should return the next page of data. - * @param {string} request.filter - * A filter to reduce results to a specific subset. Useful for querying - * phrase matchers with specific properties. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [PhraseMatcher]{@link google.cloud.contactcenterinsights.v1.PhraseMatcher}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.list_phrase_matchers.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_async - */ - listPhraseMatchersAsync( - request?: protos.google.cloud.contactcenterinsights.v1.IListPhraseMatchersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listPhraseMatchers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPhraseMatchers.asyncIterate( - this.innerApiCalls['listPhraseMatchers'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists views. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the views. - * @param {number} request.pageSize - * The maximum number of views to return in the response. If this - * value is zero, the service will select a default size. A call may return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListViewsResponse`; indicates - * that this is a continuation of a prior `ListViews` call and - * the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [View]{@link google.cloud.contactcenterinsights.v1.View}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listViewsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listViews( - request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView[], - protos.google.cloud.contactcenterinsights.v1.IListViewsRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListViewsResponse - ]>; - listViews( - request: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IView>): void; - listViews( - request: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - callback: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IView>): void; - listViews( - request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IView>, - callback?: PaginationCallback< - protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - protos.google.cloud.contactcenterinsights.v1.IListViewsResponse|null|undefined, - protos.google.cloud.contactcenterinsights.v1.IView>): - Promise<[ - protos.google.cloud.contactcenterinsights.v1.IView[], - protos.google.cloud.contactcenterinsights.v1.IListViewsRequest|null, - protos.google.cloud.contactcenterinsights.v1.IListViewsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listViews(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the views. - * @param {number} request.pageSize - * The maximum number of views to return in the response. If this - * value is zero, the service will select a default size. A call may return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListViewsResponse`; indicates - * that this is a continuation of a prior `ListViews` call and - * the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [View]{@link google.cloud.contactcenterinsights.v1.View} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listViewsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listViewsStream( - request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listViews']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listViews.createStream( - this.innerApiCalls.listViews as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listViews`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the views. - * @param {number} request.pageSize - * The maximum number of views to return in the response. If this - * value is zero, the service will select a default size. A call may return - * fewer objects than requested. A non-empty `next_page_token` in the response - * indicates that more data is available. - * @param {string} request.pageToken - * The value returned by the last `ListViewsResponse`; indicates - * that this is a continuation of a prior `ListViews` call and - * the system should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [View]{@link google.cloud.contactcenterinsights.v1.View}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1/contact_center_insights.list_views.js - * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_async - */ - listViewsAsync( - request?: protos.google.cloud.contactcenterinsights.v1.IListViewsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listViews']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listViews.asyncIterate( - this.innerApiCalls['listViews'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified analysis resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} conversation - * @param {string} analysis - * @returns {string} Resource name string. - */ - analysisPath(project:string,location:string,conversation:string,analysis:string) { - return this.pathTemplates.analysisPathTemplate.render({ - project: project, - location: location, - conversation: conversation, - analysis: analysis, - }); - } - - /** - * Parse the project from Analysis resource. - * - * @param {string} analysisName - * A fully-qualified path representing Analysis resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAnalysisName(analysisName: string) { - return this.pathTemplates.analysisPathTemplate.match(analysisName).project; - } - - /** - * Parse the location from Analysis resource. - * - * @param {string} analysisName - * A fully-qualified path representing Analysis resource. - * @returns {string} A string representing the location. - */ - matchLocationFromAnalysisName(analysisName: string) { - return this.pathTemplates.analysisPathTemplate.match(analysisName).location; - } - - /** - * Parse the conversation from Analysis resource. - * - * @param {string} analysisName - * A fully-qualified path representing Analysis resource. - * @returns {string} A string representing the conversation. - */ - matchConversationFromAnalysisName(analysisName: string) { - return this.pathTemplates.analysisPathTemplate.match(analysisName).conversation; - } - - /** - * Parse the analysis from Analysis resource. - * - * @param {string} analysisName - * A fully-qualified path representing Analysis resource. - * @returns {string} A string representing the analysis. - */ - matchAnalysisFromAnalysisName(analysisName: string) { - return this.pathTemplates.analysisPathTemplate.match(analysisName).analysis; - } - - /** - * Return a fully-qualified conversation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} conversation - * @returns {string} Resource name string. - */ - conversationPath(project:string,location:string,conversation:string) { - return this.pathTemplates.conversationPathTemplate.render({ - project: project, - location: location, - conversation: conversation, - }); - } - - /** - * Parse the project from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).project; - } - - /** - * Parse the location from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).location; - } - - /** - * Parse the conversation from Conversation resource. - * - * @param {string} conversationName - * A fully-qualified path representing Conversation resource. - * @returns {string} A string representing the conversation. - */ - matchConversationFromConversationName(conversationName: string) { - return this.pathTemplates.conversationPathTemplate.match(conversationName).conversation; - } - - /** - * Return a fully-qualified issue resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} issue_model - * @param {string} issue - * @returns {string} Resource name string. - */ - issuePath(project:string,location:string,issueModel:string,issue:string) { - return this.pathTemplates.issuePathTemplate.render({ - project: project, - location: location, - issue_model: issueModel, - issue: issue, - }); - } - - /** - * Parse the project from Issue resource. - * - * @param {string} issueName - * A fully-qualified path representing Issue resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIssueName(issueName: string) { - return this.pathTemplates.issuePathTemplate.match(issueName).project; - } - - /** - * Parse the location from Issue resource. - * - * @param {string} issueName - * A fully-qualified path representing Issue resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIssueName(issueName: string) { - return this.pathTemplates.issuePathTemplate.match(issueName).location; - } - - /** - * Parse the issue_model from Issue resource. - * - * @param {string} issueName - * A fully-qualified path representing Issue resource. - * @returns {string} A string representing the issue_model. - */ - matchIssueModelFromIssueName(issueName: string) { - return this.pathTemplates.issuePathTemplate.match(issueName).issue_model; - } - - /** - * Parse the issue from Issue resource. - * - * @param {string} issueName - * A fully-qualified path representing Issue resource. - * @returns {string} A string representing the issue. - */ - matchIssueFromIssueName(issueName: string) { - return this.pathTemplates.issuePathTemplate.match(issueName).issue; - } - - /** - * Return a fully-qualified issueModel resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} issue_model - * @returns {string} Resource name string. - */ - issueModelPath(project:string,location:string,issueModel:string) { - return this.pathTemplates.issueModelPathTemplate.render({ - project: project, - location: location, - issue_model: issueModel, - }); - } - - /** - * Parse the project from IssueModel resource. - * - * @param {string} issueModelName - * A fully-qualified path representing IssueModel resource. - * @returns {string} A string representing the project. - */ - matchProjectFromIssueModelName(issueModelName: string) { - return this.pathTemplates.issueModelPathTemplate.match(issueModelName).project; - } - - /** - * Parse the location from IssueModel resource. - * - * @param {string} issueModelName - * A fully-qualified path representing IssueModel resource. - * @returns {string} A string representing the location. - */ - matchLocationFromIssueModelName(issueModelName: string) { - return this.pathTemplates.issueModelPathTemplate.match(issueModelName).location; - } - - /** - * Parse the issue_model from IssueModel resource. - * - * @param {string} issueModelName - * A fully-qualified path representing IssueModel resource. - * @returns {string} A string representing the issue_model. - */ - matchIssueModelFromIssueModelName(issueModelName: string) { - return this.pathTemplates.issueModelPathTemplate.match(issueModelName).issue_model; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified phraseMatcher resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} phrase_matcher - * @returns {string} Resource name string. - */ - phraseMatcherPath(project:string,location:string,phraseMatcher:string) { - return this.pathTemplates.phraseMatcherPathTemplate.render({ - project: project, - location: location, - phrase_matcher: phraseMatcher, - }); - } - - /** - * Parse the project from PhraseMatcher resource. - * - * @param {string} phraseMatcherName - * A fully-qualified path representing PhraseMatcher resource. - * @returns {string} A string representing the project. - */ - matchProjectFromPhraseMatcherName(phraseMatcherName: string) { - return this.pathTemplates.phraseMatcherPathTemplate.match(phraseMatcherName).project; - } - - /** - * Parse the location from PhraseMatcher resource. - * - * @param {string} phraseMatcherName - * A fully-qualified path representing PhraseMatcher resource. - * @returns {string} A string representing the location. - */ - matchLocationFromPhraseMatcherName(phraseMatcherName: string) { - return this.pathTemplates.phraseMatcherPathTemplate.match(phraseMatcherName).location; - } - - /** - * Parse the phrase_matcher from PhraseMatcher resource. - * - * @param {string} phraseMatcherName - * A fully-qualified path representing PhraseMatcher resource. - * @returns {string} A string representing the phrase_matcher. - */ - matchPhraseMatcherFromPhraseMatcherName(phraseMatcherName: string) { - return this.pathTemplates.phraseMatcherPathTemplate.match(phraseMatcherName).phrase_matcher; - } - - /** - * Return a fully-qualified settings resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - settingsPath(project:string,location:string) { - return this.pathTemplates.settingsPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Settings resource. - * - * @param {string} settingsName - * A fully-qualified path representing Settings resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSettingsName(settingsName: string) { - return this.pathTemplates.settingsPathTemplate.match(settingsName).project; - } - - /** - * Parse the location from Settings resource. - * - * @param {string} settingsName - * A fully-qualified path representing Settings resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSettingsName(settingsName: string) { - return this.pathTemplates.settingsPathTemplate.match(settingsName).location; - } - - /** - * Return a fully-qualified view resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} view - * @returns {string} Resource name string. - */ - viewPath(project:string,location:string,view:string) { - return this.pathTemplates.viewPathTemplate.render({ - project: project, - location: location, - view: view, - }); - } - - /** - * Parse the project from View resource. - * - * @param {string} viewName - * A fully-qualified path representing View resource. - * @returns {string} A string representing the project. - */ - matchProjectFromViewName(viewName: string) { - return this.pathTemplates.viewPathTemplate.match(viewName).project; - } - - /** - * Parse the location from View resource. - * - * @param {string} viewName - * A fully-qualified path representing View resource. - * @returns {string} A string representing the location. - */ - matchLocationFromViewName(viewName: string) { - return this.pathTemplates.viewPathTemplate.match(viewName).location; - } - - /** - * Parse the view from View resource. - * - * @param {string} viewName - * A fully-qualified path representing View resource. - * @returns {string} A string representing the view. - */ - matchViewFromViewName(viewName: string) { - return this.pathTemplates.viewPathTemplate.match(viewName).view; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.contactCenterInsightsStub && !this._terminated) { - return this.contactCenterInsightsStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json deleted file mode 100644 index 081f19a1212..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_client_config.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "interfaces": { - "google.cloud.contactcenterinsights.v1.ContactCenterInsights": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateConversation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateConversation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetConversation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListConversations": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteConversation": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateAnalysis": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetAnalysis": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListAnalyses": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteAnalysis": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "BulkAnalyzeConversations": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "IngestConversations": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ExportInsightsData": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateIssueModel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateIssueModel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetIssueModel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListIssueModels": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteIssueModel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeployIssueModel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UndeployIssueModel": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetIssue": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListIssues": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateIssue": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteIssue": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CalculateIssueModelStats": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreatePhraseMatcher": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetPhraseMatcher": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListPhraseMatchers": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeletePhraseMatcher": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdatePhraseMatcher": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CalculateStats": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateSettings": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateView": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetView": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListViews": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateView": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteView": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json deleted file mode 100644 index a3a2efbf679..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/contact_center_insights_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto", - "../../protos/google/cloud/contactcenterinsights/v1/resources.proto" -] diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json deleted file mode 100644 index de8d31be6c2..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,409 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.contactcenterinsights.v1", - "libraryPackage": "@google-cloud/contact-center-insights", - "services": { - "ContactCenterInsights": { - "clients": { - "grpc": { - "libraryClient": "ContactCenterInsightsClient", - "rpcs": { - "CreateConversation": { - "methods": [ - "createConversation" - ] - }, - "UpdateConversation": { - "methods": [ - "updateConversation" - ] - }, - "GetConversation": { - "methods": [ - "getConversation" - ] - }, - "DeleteConversation": { - "methods": [ - "deleteConversation" - ] - }, - "GetAnalysis": { - "methods": [ - "getAnalysis" - ] - }, - "DeleteAnalysis": { - "methods": [ - "deleteAnalysis" - ] - }, - "UpdateIssueModel": { - "methods": [ - "updateIssueModel" - ] - }, - "GetIssueModel": { - "methods": [ - "getIssueModel" - ] - }, - "ListIssueModels": { - "methods": [ - "listIssueModels" - ] - }, - "GetIssue": { - "methods": [ - "getIssue" - ] - }, - "ListIssues": { - "methods": [ - "listIssues" - ] - }, - "UpdateIssue": { - "methods": [ - "updateIssue" - ] - }, - "DeleteIssue": { - "methods": [ - "deleteIssue" - ] - }, - "CalculateIssueModelStats": { - "methods": [ - "calculateIssueModelStats" - ] - }, - "CreatePhraseMatcher": { - "methods": [ - "createPhraseMatcher" - ] - }, - "GetPhraseMatcher": { - "methods": [ - "getPhraseMatcher" - ] - }, - "DeletePhraseMatcher": { - "methods": [ - "deletePhraseMatcher" - ] - }, - "UpdatePhraseMatcher": { - "methods": [ - "updatePhraseMatcher" - ] - }, - "CalculateStats": { - "methods": [ - "calculateStats" - ] - }, - "GetSettings": { - "methods": [ - "getSettings" - ] - }, - "UpdateSettings": { - "methods": [ - "updateSettings" - ] - }, - "CreateView": { - "methods": [ - "createView" - ] - }, - "GetView": { - "methods": [ - "getView" - ] - }, - "UpdateView": { - "methods": [ - "updateView" - ] - }, - "DeleteView": { - "methods": [ - "deleteView" - ] - }, - "CreateAnalysis": { - "methods": [ - "createAnalysis" - ] - }, - "BulkAnalyzeConversations": { - "methods": [ - "bulkAnalyzeConversations" - ] - }, - "IngestConversations": { - "methods": [ - "ingestConversations" - ] - }, - "ExportInsightsData": { - "methods": [ - "exportInsightsData" - ] - }, - "CreateIssueModel": { - "methods": [ - "createIssueModel" - ] - }, - "DeleteIssueModel": { - "methods": [ - "deleteIssueModel" - ] - }, - "DeployIssueModel": { - "methods": [ - "deployIssueModel" - ] - }, - "UndeployIssueModel": { - "methods": [ - "undeployIssueModel" - ] - }, - "ListConversations": { - "methods": [ - "listConversations", - "listConversationsStream", - "listConversationsAsync" - ] - }, - "ListAnalyses": { - "methods": [ - "listAnalyses", - "listAnalysesStream", - "listAnalysesAsync" - ] - }, - "ListPhraseMatchers": { - "methods": [ - "listPhraseMatchers", - "listPhraseMatchersStream", - "listPhraseMatchersAsync" - ] - }, - "ListViews": { - "methods": [ - "listViews", - "listViewsStream", - "listViewsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ContactCenterInsightsClient", - "rpcs": { - "CreateConversation": { - "methods": [ - "createConversation" - ] - }, - "UpdateConversation": { - "methods": [ - "updateConversation" - ] - }, - "GetConversation": { - "methods": [ - "getConversation" - ] - }, - "DeleteConversation": { - "methods": [ - "deleteConversation" - ] - }, - "GetAnalysis": { - "methods": [ - "getAnalysis" - ] - }, - "DeleteAnalysis": { - "methods": [ - "deleteAnalysis" - ] - }, - "UpdateIssueModel": { - "methods": [ - "updateIssueModel" - ] - }, - "GetIssueModel": { - "methods": [ - "getIssueModel" - ] - }, - "ListIssueModels": { - "methods": [ - "listIssueModels" - ] - }, - "GetIssue": { - "methods": [ - "getIssue" - ] - }, - "ListIssues": { - "methods": [ - "listIssues" - ] - }, - "UpdateIssue": { - "methods": [ - "updateIssue" - ] - }, - "DeleteIssue": { - "methods": [ - "deleteIssue" - ] - }, - "CalculateIssueModelStats": { - "methods": [ - "calculateIssueModelStats" - ] - }, - "CreatePhraseMatcher": { - "methods": [ - "createPhraseMatcher" - ] - }, - "GetPhraseMatcher": { - "methods": [ - "getPhraseMatcher" - ] - }, - "DeletePhraseMatcher": { - "methods": [ - "deletePhraseMatcher" - ] - }, - "UpdatePhraseMatcher": { - "methods": [ - "updatePhraseMatcher" - ] - }, - "CalculateStats": { - "methods": [ - "calculateStats" - ] - }, - "GetSettings": { - "methods": [ - "getSettings" - ] - }, - "UpdateSettings": { - "methods": [ - "updateSettings" - ] - }, - "CreateView": { - "methods": [ - "createView" - ] - }, - "GetView": { - "methods": [ - "getView" - ] - }, - "UpdateView": { - "methods": [ - "updateView" - ] - }, - "DeleteView": { - "methods": [ - "deleteView" - ] - }, - "CreateAnalysis": { - "methods": [ - "createAnalysis" - ] - }, - "BulkAnalyzeConversations": { - "methods": [ - "bulkAnalyzeConversations" - ] - }, - "IngestConversations": { - "methods": [ - "ingestConversations" - ] - }, - "ExportInsightsData": { - "methods": [ - "exportInsightsData" - ] - }, - "CreateIssueModel": { - "methods": [ - "createIssueModel" - ] - }, - "DeleteIssueModel": { - "methods": [ - "deleteIssueModel" - ] - }, - "DeployIssueModel": { - "methods": [ - "deployIssueModel" - ] - }, - "UndeployIssueModel": { - "methods": [ - "undeployIssueModel" - ] - }, - "ListConversations": { - "methods": [ - "listConversations", - "listConversationsStream", - "listConversationsAsync" - ] - }, - "ListAnalyses": { - "methods": [ - "listAnalyses", - "listAnalysesStream", - "listAnalysesAsync" - ] - }, - "ListPhraseMatchers": { - "methods": [ - "listPhraseMatchers", - "listPhraseMatchersStream", - "listPhraseMatchersAsync" - ] - }, - "ListViews": { - "methods": [ - "listViews", - "listViewsStream", - "listViewsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts deleted file mode 100644 index e558952e41d..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {ContactCenterInsightsClient} from './contact_center_insights_client'; diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 4720f20bc0d..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const contactcenterinsights = require('@google-cloud/contact-center-insights'); - -function main() { - const contactCenterInsightsClient = new contactcenterinsights.ContactCenterInsightsClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 8d2c0bf0ac7..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {ContactCenterInsightsClient} from '@google-cloud/contact-center-insights'; - -// check that the client class type name can be used -function doStuffWithContactCenterInsightsClient(client: ContactCenterInsightsClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const contactCenterInsightsClient = new ContactCenterInsightsClient(); - doStuffWithContactCenterInsightsClient(contactCenterInsightsClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts deleted file mode 100644 index 557a57558e1..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts b/owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts deleted file mode 100644 index c4ae59056ad..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/test/gapic_contact_center_insights_v1.ts +++ /dev/null @@ -1,5775 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as contactcenterinsightsModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.ContactCenterInsightsClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = contactcenterinsightsModule.v1.ContactCenterInsightsClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = contactcenterinsightsModule.v1.ContactCenterInsightsClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = contactcenterinsightsModule.v1.ContactCenterInsightsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.contactCenterInsightsStub, undefined); - await client.initialize(); - assert(client.contactCenterInsightsStub); - }); - - it('has close method for the initialized client', done => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.contactCenterInsightsStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.contactCenterInsightsStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('createConversation', () => { - it('invokes createConversation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Conversation() - ); - client.innerApiCalls.createConversation = stubSimpleCall(expectedResponse); - const [response] = await client.createConversation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Conversation() - ); - client.innerApiCalls.createConversation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createConversation( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createConversation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createConversation(request), expectedError); - const actualRequest = (client.innerApiCalls.createConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createConversation with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateConversationRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createConversation(request), expectedError); - }); - }); - - describe('updateConversation', () => { - it('invokes updateConversation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() - ); - request.conversation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); - request.conversation.name = defaultValue1; - const expectedHeaderRequestParams = `conversation.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Conversation() - ); - client.innerApiCalls.updateConversation = stubSimpleCall(expectedResponse); - const [response] = await client.updateConversation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConversation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() - ); - request.conversation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); - request.conversation.name = defaultValue1; - const expectedHeaderRequestParams = `conversation.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Conversation() - ); - client.innerApiCalls.updateConversation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateConversation( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConversation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() - ); - request.conversation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); - request.conversation.name = defaultValue1; - const expectedHeaderRequestParams = `conversation.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateConversation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateConversation(request), expectedError); - const actualRequest = (client.innerApiCalls.updateConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateConversation with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateConversationRequest() - ); - request.conversation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateConversationRequest', ['conversation', 'name']); - request.conversation.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateConversation(request), expectedError); - }); - }); - - describe('getConversation', () => { - it('invokes getConversation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Conversation() - ); - client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); - const [response] = await client.getConversation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Conversation() - ); - client.innerApiCalls.getConversation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getConversation( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getConversation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getConversation(request), expectedError); - const actualRequest = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getConversation with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetConversationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getConversation(request), expectedError); - }); - }); - - describe('deleteConversation', () => { - it('invokes deleteConversation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConversation = stubSimpleCall(expectedResponse); - const [response] = await client.deleteConversation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteConversation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteConversation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteConversation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteConversation(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteConversation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteConversation with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteConversationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteConversationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteConversation(request), expectedError); - }); - }); - - describe('getAnalysis', () => { - it('invokes getAnalysis without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Analysis() - ); - client.innerApiCalls.getAnalysis = stubSimpleCall(expectedResponse); - const [response] = await client.getAnalysis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAnalysis without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Analysis() - ); - client.innerApiCalls.getAnalysis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAnalysis( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IAnalysis|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAnalysis with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAnalysis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAnalysis(request), expectedError); - const actualRequest = (client.innerApiCalls.getAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAnalysis with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAnalysis(request), expectedError); - }); - }); - - describe('deleteAnalysis', () => { - it('invokes deleteAnalysis without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAnalysis = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAnalysis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAnalysis without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAnalysis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAnalysis( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAnalysis with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAnalysis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAnalysis(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAnalysis with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAnalysis(request), expectedError); - }); - }); - - describe('updateIssueModel', () => { - it('invokes updateIssueModel without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() - ); - request.issueModel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); - request.issueModel.name = defaultValue1; - const expectedHeaderRequestParams = `issue_model.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IssueModel() - ); - client.innerApiCalls.updateIssueModel = stubSimpleCall(expectedResponse); - const [response] = await client.updateIssueModel(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateIssueModel without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() - ); - request.issueModel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); - request.issueModel.name = defaultValue1; - const expectedHeaderRequestParams = `issue_model.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IssueModel() - ); - client.innerApiCalls.updateIssueModel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateIssueModel( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssueModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateIssueModel with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() - ); - request.issueModel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); - request.issueModel.name = defaultValue1; - const expectedHeaderRequestParams = `issue_model.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIssueModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateIssueModel(request), expectedError); - const actualRequest = (client.innerApiCalls.updateIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateIssueModel with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest() - ); - request.issueModel ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueModelRequest', ['issueModel', 'name']); - request.issueModel.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateIssueModel(request), expectedError); - }); - }); - - describe('getIssueModel', () => { - it('invokes getIssueModel without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IssueModel() - ); - client.innerApiCalls.getIssueModel = stubSimpleCall(expectedResponse); - const [response] = await client.getIssueModel(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIssueModel without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IssueModel() - ); - client.innerApiCalls.getIssueModel = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIssueModel( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssueModel|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIssueModel with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIssueModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIssueModel(request), expectedError); - const actualRequest = (client.innerApiCalls.getIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIssueModel with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIssueModel(request), expectedError); - }); - }); - - describe('listIssueModels', () => { - it('invokes listIssueModels without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsResponse() - ); - client.innerApiCalls.listIssueModels = stubSimpleCall(expectedResponse); - const [response] = await client.listIssueModels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listIssueModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIssueModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIssueModels without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsResponse() - ); - client.innerApiCalls.listIssueModels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIssueModels( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IListIssueModelsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listIssueModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIssueModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIssueModels with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIssueModels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIssueModels(request), expectedError); - const actualRequest = (client.innerApiCalls.listIssueModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIssueModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIssueModels with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssueModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listIssueModels(request), expectedError); - }); - }); - - describe('getIssue', () => { - it('invokes getIssue without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Issue() - ); - client.innerApiCalls.getIssue = stubSimpleCall(expectedResponse); - const [response] = await client.getIssue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIssue without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Issue() - ); - client.innerApiCalls.getIssue = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIssue( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssue|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIssue with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIssue = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIssue(request), expectedError); - const actualRequest = (client.innerApiCalls.getIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIssue with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetIssueRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIssue(request), expectedError); - }); - }); - - describe('listIssues', () => { - it('invokes listIssues without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssuesResponse() - ); - client.innerApiCalls.listIssues = stubSimpleCall(expectedResponse); - const [response] = await client.listIssues(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listIssues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIssues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIssues without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssuesResponse() - ); - client.innerApiCalls.listIssues = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIssues( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IListIssuesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listIssues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIssues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIssues with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIssues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIssues(request), expectedError); - const actualRequest = (client.innerApiCalls.listIssues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIssues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIssues with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listIssues(request), expectedError); - }); - }); - - describe('updateIssue', () => { - it('invokes updateIssue without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() - ); - request.issue ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); - request.issue.name = defaultValue1; - const expectedHeaderRequestParams = `issue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Issue() - ); - client.innerApiCalls.updateIssue = stubSimpleCall(expectedResponse); - const [response] = await client.updateIssue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateIssue without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() - ); - request.issue ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); - request.issue.name = defaultValue1; - const expectedHeaderRequestParams = `issue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Issue() - ); - client.innerApiCalls.updateIssue = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateIssue( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IIssue|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateIssue with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() - ); - request.issue ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); - request.issue.name = defaultValue1; - const expectedHeaderRequestParams = `issue.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIssue = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateIssue(request), expectedError); - const actualRequest = (client.innerApiCalls.updateIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateIssue with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateIssueRequest() - ); - request.issue ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateIssueRequest', ['issue', 'name']); - request.issue.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateIssue(request), expectedError); - }); - }); - - describe('deleteIssue', () => { - it('invokes deleteIssue without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteIssue = stubSimpleCall(expectedResponse); - const [response] = await client.deleteIssue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIssue without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteIssue = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIssue( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIssue with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIssue = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteIssue(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteIssue as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssue as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIssue with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteIssue(request), expectedError); - }); - }); - - describe('calculateIssueModelStats', () => { - it('invokes calculateIssueModelStats without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); - request.issueModel = defaultValue1; - const expectedHeaderRequestParams = `issue_model=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse() - ); - client.innerApiCalls.calculateIssueModelStats = stubSimpleCall(expectedResponse); - const [response] = await client.calculateIssueModelStats(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.calculateIssueModelStats as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.calculateIssueModelStats as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes calculateIssueModelStats without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); - request.issueModel = defaultValue1; - const expectedHeaderRequestParams = `issue_model=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsResponse() - ); - client.innerApiCalls.calculateIssueModelStats = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.calculateIssueModelStats( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ICalculateIssueModelStatsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.calculateIssueModelStats as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.calculateIssueModelStats as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes calculateIssueModelStats with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); - request.issueModel = defaultValue1; - const expectedHeaderRequestParams = `issue_model=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.calculateIssueModelStats = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.calculateIssueModelStats(request), expectedError); - const actualRequest = (client.innerApiCalls.calculateIssueModelStats as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.calculateIssueModelStats as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes calculateIssueModelStats with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateIssueModelStatsRequest', ['issueModel']); - request.issueModel = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.calculateIssueModelStats(request), expectedError); - }); - }); - - describe('createPhraseMatcher', () => { - it('invokes createPhraseMatcher without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() - ); - client.innerApiCalls.createPhraseMatcher = stubSimpleCall(expectedResponse); - const [response] = await client.createPhraseMatcher(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createPhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createPhraseMatcher without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() - ); - client.innerApiCalls.createPhraseMatcher = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createPhraseMatcher( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createPhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createPhraseMatcher with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createPhraseMatcher = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createPhraseMatcher(request), expectedError); - const actualRequest = (client.innerApiCalls.createPhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createPhraseMatcher with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreatePhraseMatcherRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createPhraseMatcher(request), expectedError); - }); - }); - - describe('getPhraseMatcher', () => { - it('invokes getPhraseMatcher without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() - ); - client.innerApiCalls.getPhraseMatcher = stubSimpleCall(expectedResponse); - const [response] = await client.getPhraseMatcher(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPhraseMatcher without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() - ); - client.innerApiCalls.getPhraseMatcher = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getPhraseMatcher( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getPhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPhraseMatcher with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getPhraseMatcher = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPhraseMatcher(request), expectedError); - const actualRequest = (client.innerApiCalls.getPhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getPhraseMatcher with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetPhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getPhraseMatcher(request), expectedError); - }); - }); - - describe('deletePhraseMatcher', () => { - it('invokes deletePhraseMatcher without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deletePhraseMatcher = stubSimpleCall(expectedResponse); - const [response] = await client.deletePhraseMatcher(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deletePhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deletePhraseMatcher without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deletePhraseMatcher = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deletePhraseMatcher( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deletePhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deletePhraseMatcher with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePhraseMatcher = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deletePhraseMatcher(request), expectedError); - const actualRequest = (client.innerApiCalls.deletePhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deletePhraseMatcher with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeletePhraseMatcherRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deletePhraseMatcher(request), expectedError); - }); - }); - - describe('updatePhraseMatcher', () => { - it('invokes updatePhraseMatcher without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() - ); - request.phraseMatcher ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); - request.phraseMatcher.name = defaultValue1; - const expectedHeaderRequestParams = `phrase_matcher.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() - ); - client.innerApiCalls.updatePhraseMatcher = stubSimpleCall(expectedResponse); - const [response] = await client.updatePhraseMatcher(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updatePhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updatePhraseMatcher without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() - ); - request.phraseMatcher ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); - request.phraseMatcher.name = defaultValue1; - const expectedHeaderRequestParams = `phrase_matcher.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher() - ); - client.innerApiCalls.updatePhraseMatcher = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updatePhraseMatcher( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updatePhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updatePhraseMatcher with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() - ); - request.phraseMatcher ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); - request.phraseMatcher.name = defaultValue1; - const expectedHeaderRequestParams = `phrase_matcher.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updatePhraseMatcher = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updatePhraseMatcher(request), expectedError); - const actualRequest = (client.innerApiCalls.updatePhraseMatcher as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updatePhraseMatcher as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updatePhraseMatcher with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest() - ); - request.phraseMatcher ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest', ['phraseMatcher', 'name']); - request.phraseMatcher.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updatePhraseMatcher(request), expectedError); - }); - }); - - describe('calculateStats', () => { - it('invokes calculateStats without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateStatsResponse() - ); - client.innerApiCalls.calculateStats = stubSimpleCall(expectedResponse); - const [response] = await client.calculateStats(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.calculateStats as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.calculateStats as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes calculateStats without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateStatsResponse() - ); - client.innerApiCalls.calculateStats = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.calculateStats( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ICalculateStatsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.calculateStats as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.calculateStats as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes calculateStats with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.calculateStats = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.calculateStats(request), expectedError); - const actualRequest = (client.innerApiCalls.calculateStats as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.calculateStats as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes calculateStats with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CalculateStatsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CalculateStatsRequest', ['location']); - request.location = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.calculateStats(request), expectedError); - }); - }); - - describe('getSettings', () => { - it('invokes getSettings without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Settings() - ); - client.innerApiCalls.getSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSettings without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Settings() - ); - client.innerApiCalls.getSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSettings( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ISettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSettings with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSettings with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSettings(request), expectedError); - }); - }); - - describe('updateSettings', () => { - it('invokes updateSettings without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Settings() - ); - client.innerApiCalls.updateSettings = stubSimpleCall(expectedResponse); - const [response] = await client.updateSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSettings without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.Settings() - ); - client.innerApiCalls.updateSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSettings( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.ISettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSettings with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSettings with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest() - ); - request.settings ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest', ['settings', 'name']); - request.settings.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateSettings(request), expectedError); - }); - }); - - describe('createView', () => { - it('invokes createView without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.View() - ); - client.innerApiCalls.createView = stubSimpleCall(expectedResponse); - const [response] = await client.createView(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createView without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.View() - ); - client.innerApiCalls.createView = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createView( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createView with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createView = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createView(request), expectedError); - const actualRequest = (client.innerApiCalls.createView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createView with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateViewRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createView(request), expectedError); - }); - }); - - describe('getView', () => { - it('invokes getView without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.View() - ); - client.innerApiCalls.getView = stubSimpleCall(expectedResponse); - const [response] = await client.getView(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getView without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.View() - ); - client.innerApiCalls.getView = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getView( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getView with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getView = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getView(request), expectedError); - const actualRequest = (client.innerApiCalls.getView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getView with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.GetViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.GetViewRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getView(request), expectedError); - }); - }); - - describe('updateView', () => { - it('invokes updateView without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() - ); - request.view ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); - request.view.name = defaultValue1; - const expectedHeaderRequestParams = `view.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.View() - ); - client.innerApiCalls.updateView = stubSimpleCall(expectedResponse); - const [response] = await client.updateView(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateView without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() - ); - request.view ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); - request.view.name = defaultValue1; - const expectedHeaderRequestParams = `view.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.View() - ); - client.innerApiCalls.updateView = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateView( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateView with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() - ); - request.view ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); - request.view.name = defaultValue1; - const expectedHeaderRequestParams = `view.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateView = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateView(request), expectedError); - const actualRequest = (client.innerApiCalls.updateView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateView with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UpdateViewRequest() - ); - request.view ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UpdateViewRequest', ['view', 'name']); - request.view.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateView(request), expectedError); - }); - }); - - describe('deleteView', () => { - it('invokes deleteView without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteView = stubSimpleCall(expectedResponse); - const [response] = await client.deleteView(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteView without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteView = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteView( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteView with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteView = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteView(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteView as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteView as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteView with closed client', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteViewRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteViewRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteView(request), expectedError); - }); - }); - - describe('createAnalysis', () => { - it('invokes createAnalysis without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createAnalysis = stubLongRunningCall(expectedResponse); - const [operation] = await client.createAnalysis(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAnalysis without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createAnalysis = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAnalysis( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAnalysis with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAnalysis = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createAnalysis(request), expectedError); - const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAnalysis with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAnalysis = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createAnalysis(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAnalysis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateAnalysisProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateAnalysisProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateAnalysisProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateAnalysisProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('bulkAnalyzeConversations', () => { - it('invokes bulkAnalyzeConversations without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall(expectedResponse); - const [operation] = await client.bulkAnalyzeConversations(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes bulkAnalyzeConversations without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.bulkAnalyzeConversations( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes bulkAnalyzeConversations with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.bulkAnalyzeConversations(request), expectedError); - const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes bulkAnalyzeConversations with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.bulkAnalyzeConversations(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.bulkAnalyzeConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBulkAnalyzeConversationsProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkBulkAnalyzeConversationsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBulkAnalyzeConversationsProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkBulkAnalyzeConversationsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('ingestConversations', () => { - it('invokes ingestConversations without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.ingestConversations = stubLongRunningCall(expectedResponse); - const [operation] = await client.ingestConversations(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes ingestConversations without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.ingestConversations = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.ingestConversations( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes ingestConversations with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.ingestConversations = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.ingestConversations(request), expectedError); - const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes ingestConversations with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.ingestConversations = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.ingestConversations(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.ingestConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkIngestConversationsProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkIngestConversationsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkIngestConversationsProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkIngestConversationsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('exportInsightsData', () => { - it('invokes exportInsightsData without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportInsightsData = stubLongRunningCall(expectedResponse); - const [operation] = await client.exportInsightsData(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportInsightsData without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.exportInsightsData = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportInsightsData( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportInsightsData with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportInsightsData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportInsightsData(request), expectedError); - const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportInsightsData with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportInsightsData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportInsightsData(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportInsightsData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkExportInsightsDataProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportInsightsDataProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportInsightsDataProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkExportInsightsDataProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createIssueModel', () => { - it('invokes createIssueModel without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createIssueModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.createIssueModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createIssueModel without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createIssueModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createIssueModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createIssueModel with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIssueModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIssueModel(request), expectedError); - const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createIssueModel with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.CreateIssueModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIssueModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIssueModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateIssueModelProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateIssueModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateIssueModelProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateIssueModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteIssueModel', () => { - it('invokes deleteIssueModel without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteIssueModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteIssueModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIssueModel without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteIssueModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIssueModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIssueModel with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIssueModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIssueModel(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIssueModel with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeleteIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIssueModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIssueModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteIssueModelProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteIssueModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteIssueModelProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteIssueModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployIssueModel', () => { - it('invokes deployIssueModel without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deployIssueModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployIssueModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployIssueModel without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deployIssueModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployIssueModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployIssueModel with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIssueModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployIssueModel(request), expectedError); - const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployIssueModel with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.DeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIssueModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployIssueModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeployIssueModelProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeployIssueModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployIssueModelProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeployIssueModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployIssueModel', () => { - it('invokes undeployIssueModel without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeployIssueModel = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployIssueModel(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployIssueModel without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeployIssueModel = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployIssueModel( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployIssueModel with call error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIssueModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployIssueModel(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployIssueModel with LRO error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.UndeployIssueModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIssueModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployIssueModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIssueModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUndeployIssueModelProgress without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUndeployIssueModelProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployIssueModelProgress with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUndeployIssueModelProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listConversations', () => { - it('invokes listConversations without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - ]; - client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); - const [response] = await client.listConversations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversations without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - ]; - client.innerApiCalls.listConversations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listConversations( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IConversation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversations with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listConversations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listConversations(request), expectedError); - const actualRequest = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listConversations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listConversationsStream without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - ]; - client.descriptors.page.listConversations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listConversationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.Conversation[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Conversation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); - assert( - (client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listConversationsStream with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConversations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listConversationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.Conversation[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Conversation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listConversations, request)); - assert( - (client.descriptors.page.listConversations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversations without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Conversation()), - ]; - client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contactcenterinsights.v1.IConversation[] = []; - const iterable = client.listConversationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listConversations with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListConversationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListConversationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listConversationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contactcenterinsights.v1.IConversation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listConversations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listAnalyses', () => { - it('invokes listAnalyses without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - ]; - client.innerApiCalls.listAnalyses = stubSimpleCall(expectedResponse); - const [response] = await client.listAnalyses(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAnalyses as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnalyses as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAnalyses without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - ]; - client.innerApiCalls.listAnalyses = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAnalyses( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IAnalysis[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAnalyses as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnalyses as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAnalyses with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAnalyses = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAnalyses(request), expectedError); - const actualRequest = (client.innerApiCalls.listAnalyses as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnalyses as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAnalysesStream without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - ]; - client.descriptors.page.listAnalyses.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAnalysesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.Analysis[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Analysis) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAnalyses.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAnalyses, request)); - assert( - (client.descriptors.page.listAnalyses.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAnalysesStream with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAnalyses.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAnalysesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.Analysis[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.Analysis) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAnalyses.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAnalyses, request)); - assert( - (client.descriptors.page.listAnalyses.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAnalyses without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.Analysis()), - ]; - client.descriptors.page.listAnalyses.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contactcenterinsights.v1.IAnalysis[] = []; - const iterable = client.listAnalysesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAnalyses with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListAnalysesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListAnalysesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAnalyses.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAnalysesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contactcenterinsights.v1.IAnalysis[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAnalyses.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listPhraseMatchers', () => { - it('invokes listPhraseMatchers without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - ]; - client.innerApiCalls.listPhraseMatchers = stubSimpleCall(expectedResponse); - const [response] = await client.listPhraseMatchers(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listPhraseMatchers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPhraseMatchers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPhraseMatchers without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - ]; - client.innerApiCalls.listPhraseMatchers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listPhraseMatchers( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listPhraseMatchers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPhraseMatchers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPhraseMatchers with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listPhraseMatchers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPhraseMatchers(request), expectedError); - const actualRequest = (client.innerApiCalls.listPhraseMatchers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPhraseMatchers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPhraseMatchersStream without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - ]; - client.descriptors.page.listPhraseMatchers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listPhraseMatchersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listPhraseMatchers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPhraseMatchers, request)); - assert( - (client.descriptors.page.listPhraseMatchers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listPhraseMatchersStream with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPhraseMatchers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listPhraseMatchersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.PhraseMatcher) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listPhraseMatchers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPhraseMatchers, request)); - assert( - (client.descriptors.page.listPhraseMatchers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listPhraseMatchers without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.PhraseMatcher()), - ]; - client.descriptors.page.listPhraseMatchers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[] = []; - const iterable = client.listPhraseMatchersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listPhraseMatchers with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListPhraseMatchersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPhraseMatchers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPhraseMatchersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contactcenterinsights.v1.IPhraseMatcher[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listPhraseMatchers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listViews', () => { - it('invokes listViews without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - ]; - client.innerApiCalls.listViews = stubSimpleCall(expectedResponse); - const [response] = await client.listViews(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listViews as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listViews as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listViews without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - ]; - client.innerApiCalls.listViews = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listViews( - request, - (err?: Error|null, result?: protos.google.cloud.contactcenterinsights.v1.IView[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listViews as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listViews as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listViews with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listViews = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listViews(request), expectedError); - const actualRequest = (client.innerApiCalls.listViews as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listViews as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listViewsStream without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - ]; - client.descriptors.page.listViews.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listViewsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.View[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.View) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listViews.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listViews, request)); - assert( - (client.descriptors.page.listViews.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listViewsStream with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listViews.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listViewsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.contactcenterinsights.v1.View[] = []; - stream.on('data', (response: protos.google.cloud.contactcenterinsights.v1.View) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listViews.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listViews, request)); - assert( - (client.descriptors.page.listViews.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listViews without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - generateSampleMessage(new protos.google.cloud.contactcenterinsights.v1.View()), - ]; - client.descriptors.page.listViews.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.contactcenterinsights.v1.IView[] = []; - const iterable = client.listViewsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listViews.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listViews.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listViews with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.contactcenterinsights.v1.ListViewsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.contactcenterinsights.v1.ListViewsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listViews.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listViewsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.contactcenterinsights.v1.IView[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listViews.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listViews.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('analysis', () => { - const fakePath = "/rendered/path/analysis"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - conversation: "conversationValue", - analysis: "analysisValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.analysisPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.analysisPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('analysisPath', () => { - const result = client.analysisPath("projectValue", "locationValue", "conversationValue", "analysisValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.analysisPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAnalysisName', () => { - const result = client.matchProjectFromAnalysisName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromAnalysisName', () => { - const result = client.matchLocationFromAnalysisName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversationFromAnalysisName', () => { - const result = client.matchConversationFromAnalysisName(fakePath); - assert.strictEqual(result, "conversationValue"); - assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAnalysisFromAnalysisName', () => { - const result = client.matchAnalysisFromAnalysisName(fakePath); - assert.strictEqual(result, "analysisValue"); - assert((client.pathTemplates.analysisPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('conversation', () => { - const fakePath = "/rendered/path/conversation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - conversation: "conversationValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.conversationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.conversationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('conversationPath', () => { - const result = client.conversationPath("projectValue", "locationValue", "conversationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.conversationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromConversationName', () => { - const result = client.matchProjectFromConversationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromConversationName', () => { - const result = client.matchLocationFromConversationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchConversationFromConversationName', () => { - const result = client.matchConversationFromConversationName(fakePath); - assert.strictEqual(result, "conversationValue"); - assert((client.pathTemplates.conversationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('issue', () => { - const fakePath = "/rendered/path/issue"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - issue_model: "issueModelValue", - issue: "issueValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.issuePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.issuePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('issuePath', () => { - const result = client.issuePath("projectValue", "locationValue", "issueModelValue", "issueValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.issuePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIssueName', () => { - const result = client.matchProjectFromIssueName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.issuePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIssueName', () => { - const result = client.matchLocationFromIssueName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.issuePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIssueModelFromIssueName', () => { - const result = client.matchIssueModelFromIssueName(fakePath); - assert.strictEqual(result, "issueModelValue"); - assert((client.pathTemplates.issuePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIssueFromIssueName', () => { - const result = client.matchIssueFromIssueName(fakePath); - assert.strictEqual(result, "issueValue"); - assert((client.pathTemplates.issuePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('issueModel', () => { - const fakePath = "/rendered/path/issueModel"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - issue_model: "issueModelValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.issueModelPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.issueModelPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('issueModelPath', () => { - const result = client.issueModelPath("projectValue", "locationValue", "issueModelValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.issueModelPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromIssueModelName', () => { - const result = client.matchProjectFromIssueModelName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.issueModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromIssueModelName', () => { - const result = client.matchLocationFromIssueModelName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.issueModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchIssueModelFromIssueModelName', () => { - const result = client.matchIssueModelFromIssueModelName(fakePath); - assert.strictEqual(result, "issueModelValue"); - assert((client.pathTemplates.issueModelPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('phraseMatcher', () => { - const fakePath = "/rendered/path/phraseMatcher"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - phrase_matcher: "phraseMatcherValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.phraseMatcherPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.phraseMatcherPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('phraseMatcherPath', () => { - const result = client.phraseMatcherPath("projectValue", "locationValue", "phraseMatcherValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.phraseMatcherPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromPhraseMatcherName', () => { - const result = client.matchProjectFromPhraseMatcherName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.phraseMatcherPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromPhraseMatcherName', () => { - const result = client.matchLocationFromPhraseMatcherName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.phraseMatcherPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchPhraseMatcherFromPhraseMatcherName', () => { - const result = client.matchPhraseMatcherFromPhraseMatcherName(fakePath); - assert.strictEqual(result, "phraseMatcherValue"); - assert((client.pathTemplates.phraseMatcherPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('settings', () => { - const fakePath = "/rendered/path/settings"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.settingsPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.settingsPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('settingsPath', () => { - const result = client.settingsPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.settingsPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSettingsName', () => { - const result = client.matchProjectFromSettingsName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.settingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSettingsName', () => { - const result = client.matchLocationFromSettingsName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.settingsPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('view', () => { - const fakePath = "/rendered/path/view"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - view: "viewValue", - }; - const client = new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.viewPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.viewPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('viewPath', () => { - const result = client.viewPath("projectValue", "locationValue", "viewValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.viewPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromViewName', () => { - const result = client.matchProjectFromViewName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.viewPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromViewName', () => { - const result = client.matchLocationFromViewName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.viewPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchViewFromViewName', () => { - const result = client.matchViewFromViewName(fakePath); - assert.strictEqual(result, "viewValue"); - assert((client.pathTemplates.viewPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json b/owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js b/owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js deleted file mode 100644 index 97e7287c607..00000000000 --- a/owl-bot-staging/google-cloud-contactcenterinsights/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'ContactCenterInsights', - filename: './contact-center-insights.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-contactcenterinsights/README.md b/packages/google-cloud-contactcenterinsights/README.md index b8683873c39..70264defd4d 100644 --- a/packages/google-cloud-contactcenterinsights/README.md +++ b/packages/google-cloud-contactcenterinsights/README.md @@ -87,6 +87,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Contact_center_insights.bulk_analyze_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js,samples/README.md) | | Contact_center_insights.calculate_issue_model_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js,samples/README.md) | | Contact_center_insights.calculate_stats | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_stats.js,samples/README.md) | | Contact_center_insights.create_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_analysis.js,samples/README.md) | @@ -96,6 +97,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Contact_center_insights.create_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.create_view.js,samples/README.md) | | Contact_center_insights.delete_analysis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_analysis.js,samples/README.md) | | Contact_center_insights.delete_conversation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_conversation.js,samples/README.md) | +| Contact_center_insights.delete_issue | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js,samples/README.md) | | Contact_center_insights.delete_issue_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js,samples/README.md) | | Contact_center_insights.delete_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_phrase_matcher.js,samples/README.md) | | Contact_center_insights.delete_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_view.js,samples/README.md) | @@ -108,6 +110,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Contact_center_insights.get_phrase_matcher | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_phrase_matcher.js,samples/README.md) | | Contact_center_insights.get_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_settings.js,samples/README.md) | | Contact_center_insights.get_view | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.get_view.js,samples/README.md) | +| Contact_center_insights.ingest_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js,samples/README.md) | | Contact_center_insights.list_analyses | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js,samples/README.md) | | Contact_center_insights.list_conversations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_conversations.js,samples/README.md) | | Contact_center_insights.list_issue_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_issue_models.js,samples/README.md) | diff --git a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto index c5956b93f16..1ecf4321683 100644 --- a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto +++ b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/contact_center_insights.proto @@ -121,6 +121,33 @@ service ContactCenterInsights { option (google.api.method_signature) = "name"; } + // Analyzes multiple conversations in a single request. + rpc BulkAnalyzeConversations(BulkAnalyzeConversationsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversations:bulkAnalyze" + body: "*" + }; + option (google.api.method_signature) = "parent,filter,analysis_percentage"; + option (google.longrunning.operation_info) = { + response_type: "BulkAnalyzeConversationsResponse" + metadata_type: "BulkAnalyzeConversationsMetadata" + }; + } + + // Imports conversations and processes them according to the user's + // configuration. + rpc IngestConversations(IngestConversationsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/conversations:ingest" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "IngestConversationsResponse" + metadata_type: "IngestConversationsMetadata" + }; + } + // Export insights data to a destination defined in the request body. rpc ExportInsightsData(ExportInsightsDataRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -237,6 +264,14 @@ service ContactCenterInsights { option (google.api.method_signature) = "issue,update_mask"; } + // Deletes an issue. + rpc DeleteIssue(DeleteIssueRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}" + }; + option (google.api.method_signature) = "name"; + } + // Gets an issue model's statistics. rpc CalculateIssueModelStats(CalculateIssueModelStatsRequest) returns (CalculateIssueModelStatsResponse) { option (google.api.http) = { @@ -456,6 +491,9 @@ message CreateAnalysisOperationMetadata { type: "contactcenterinsights.googleapis.com/Conversation" } ]; + + // Output only. The annotator selector used for the analysis (if any). + AnnotatorSelector annotator_selector = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request to create a conversation. @@ -559,6 +597,73 @@ message DeleteConversationRequest { bool force = 2; } +// The request to ingest conversations. +message IngestConversationsRequest { + // Configuration for Cloud Storage bucket sources. + message GcsSource { + // Required. The Cloud Storage bucket containing source objects. + string bucket_uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration for processing transcript objects. + message TranscriptObjectConfig { + // Required. The medium transcript objects represent. + Conversation.Medium medium = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration that applies to all conversations. + message ConversationConfig { + // An opaque, user-specified string representing the human agent who handled + // the conversations. + string agent_id = 1; + } + + // Configuration for an external data store containing objects that will + // be converted to conversations. + oneof source { + // A cloud storage bucket source. + GcsSource gcs_source = 2; + } + + // Configuration for converting individual `source` objects to conversations. + oneof object_config { + // Configuration for when `source` contains conversation transcripts. + TranscriptObjectConfig transcript_object_config = 3; + } + + // Required. The parent resource for new conversations. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Configuration that applies to all conversations. + ConversationConfig conversation_config = 4; +} + +// The metadata for an IngestConversations operation. +message IngestConversationsMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The original request for ingest. + IngestConversationsRequest request = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Partial errors during ingest operation that might cause the operation + // output to be incomplete. + repeated google.rpc.Status partial_errors = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The response to an IngestConversations operation. +message IngestConversationsResponse { + +} + // The request to create an analysis. message CreateAnalysisRequest { // Required. The parent resource of the analysis. @@ -631,6 +736,59 @@ message DeleteAnalysisRequest { ]; } +// The request to analyze conversations in bulk. +message BulkAnalyzeConversationsRequest { + // Required. The parent resource to create analyses in. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Filter used to select the subset of conversations to analyze. + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Percentage of selected conversation to analyze, between + // [0, 100]. + float analysis_percentage = 3 [(google.api.field_behavior) = REQUIRED]; + + // To select the annotators to run and the phrase matchers to use + // (if any). If not specified, all annotators will be run. + AnnotatorSelector annotator_selector = 8; +} + +// The metadata for a bulk analyze conversations operation. +message BulkAnalyzeConversationsMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // The original request for bulk analyze. + BulkAnalyzeConversationsRequest request = 3; + + // The number of requested analyses that have completed successfully so far. + int32 completed_analyses_count = 4; + + // The number of requested analyses that have failed so far. + int32 failed_analyses_count = 5; + + // Total number of analyses requested. Computed by the number of conversations + // returned by `filter` multiplied by `analysis_percentage` in the request. + int32 total_requested_analyses_count = 6; +} + +// The response for a bulk analyze conversations operation. +message BulkAnalyzeConversationsResponse { + // Count of successful analyses. + int32 successful_analysis_count = 1; + + // Count of failed analyses. + int32 failed_analysis_count = 2; +} + // The request to export insights. message ExportInsightsDataRequest { // A BigQuery Table Reference. @@ -891,6 +1049,17 @@ message UpdateIssueRequest { google.protobuf.FieldMask update_mask = 2; } +// The request to delete an issue. +message DeleteIssueRequest { + // Required. The name of the issue to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/Issue" + } + ]; +} + // Request to get statistics of an issue model. message CalculateIssueModelStatsRequest { // Required. The resource name of the issue model to query against. diff --git a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto index bac8515aab5..715eff61177 100644 --- a/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto +++ b/packages/google-cloud-contactcenterinsights/protos/google/cloud/contactcenterinsights/v1/resources.proto @@ -227,6 +227,10 @@ message Analysis { // Output only. The result of the analysis, which is populated when the analysis // finishes. AnalysisResult analysis_result = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // To select the annotators to run and the phrase matchers to use + // (if any). If not specified, all annotators will be run. + AnnotatorSelector annotator_selector = 8; } // The conversation source, which is a combination of transcript and audio. @@ -356,6 +360,9 @@ message CallAnnotation { // Data specifying a phrase match. PhraseMatchData phrase_match_data = 17; + + // Data specifying an issue match. + IssueMatchData issue_match_data = 18; } // The channel of the audio where the annotation occurs. For single-channel @@ -579,6 +586,12 @@ message SentimentData { float score = 2; } +// The data for an issue match annotation. +message IssueMatchData { + // Information about the issue's assignment. + IssueAssignment issue_assignment = 1; +} + // The issue model resource. message IssueModel { option (google.api.resource) = { @@ -670,6 +683,10 @@ message Issue { // Output only. The most recent time that this issue was updated. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource names of the sample representative utterances that match to this + // issue. + repeated string sample_utterances = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Aggregated statistics about an issue model. @@ -828,6 +845,10 @@ message Settings { // Percentage of conversations created using Dialogflow runtime integration // to analyze automatically, between [0, 100]. double runtime_integration_analysis_percentage = 1; + + // To select the annotators to run and the phrase matchers to use + // (if any). If not specified, all annotators will be run. + AnnotatorSelector annotator_selector = 5; } // Immutable. The resource name of the settings resource. @@ -1114,3 +1135,46 @@ message View { // String with specific view properties. string value = 5; } + +// Selector of all available annotators and phrase matchers to run. +message AnnotatorSelector { + // Whether to run the interruption annotator. + bool run_interruption_annotator = 1; + + // Whether to run the silence annotator. + bool run_silence_annotator = 2; + + // Whether to run the active phrase matcher annotator(s). + bool run_phrase_matcher_annotator = 3; + + // The list of phrase matchers to run. If not provided, all active phrase + // matchers will be used. If inactive phrase matchers are provided, they will + // not be used. Phrase matchers will be run only if + // run_phrase_matcher_annotator is set to true. Format: + // projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher} + repeated string phrase_matchers = 4 [(google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/PhraseMatcher" + }]; + + // Whether to run the sentiment annotator. + bool run_sentiment_annotator = 5; + + // Whether to run the entity annotator. + bool run_entity_annotator = 6; + + // Whether to run the intent annotator. + bool run_intent_annotator = 7; + + // Whether to run the issue model annotator. A model should have already been + // deployed for this to take effect. + bool run_issue_model_annotator = 8; + + // The issue model to run. If not provided, the most recently deployed topic + // model will be used. The provided issue model will only be used for + // inference if the issue model is deployed and if run_issue_model_annotator + // is set to true. If more than one issue model is provided, only the first + // provided issue model will be used for inference. + repeated string issue_models = 10 [(google.api.resource_reference) = { + type: "contactcenterinsights.googleapis.com/IssueModel" + }]; +} diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.d.ts b/packages/google-cloud-contactcenterinsights/protos/protos.d.ts index c54fe68d054..70b95c70d99 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.d.ts +++ b/packages/google-cloud-contactcenterinsights/protos/protos.d.ts @@ -172,6 +172,34 @@ export namespace google { */ public deleteAnalysis(request: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest): Promise; + /** + * Calls BulkAnalyzeConversations. + * @param request BulkAnalyzeConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public bulkAnalyzeConversations(request: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, callback: google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversationsCallback): void; + + /** + * Calls BulkAnalyzeConversations. + * @param request BulkAnalyzeConversationsRequest message or plain object + * @returns Promise + */ + public bulkAnalyzeConversations(request: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest): Promise; + + /** + * Calls IngestConversations. + * @param request IngestConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public ingestConversations(request: google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, callback: google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversationsCallback): void; + + /** + * Calls IngestConversations. + * @param request IngestConversationsRequest message or plain object + * @returns Promise + */ + public ingestConversations(request: google.cloud.contactcenterinsights.v1.IIngestConversationsRequest): Promise; + /** * Calls ExportInsightsData. * @param request ExportInsightsDataRequest message or plain object @@ -326,6 +354,20 @@ export namespace google { */ public updateIssue(request: google.cloud.contactcenterinsights.v1.IUpdateIssueRequest): Promise; + /** + * Calls DeleteIssue. + * @param request DeleteIssueRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteIssue(request: google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, callback: google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueCallback): void; + + /** + * Calls DeleteIssue. + * @param request DeleteIssueRequest message or plain object + * @returns Promise + */ + public deleteIssue(request: google.cloud.contactcenterinsights.v1.IDeleteIssueRequest): Promise; + /** * Calls CalculateIssueModelStats. * @param request CalculateIssueModelStatsRequest message or plain object @@ -588,6 +630,20 @@ export namespace google { */ type DeleteAnalysisCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|bulkAnalyzeConversations}. + * @param error Error, if any + * @param [response] Operation + */ + type BulkAnalyzeConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|ingestConversations}. + * @param error Error, if any + * @param [response] Operation + */ + type IngestConversationsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|exportInsightsData}. * @param error Error, if any @@ -665,6 +721,13 @@ export namespace google { */ type UpdateIssueCallback = (error: (Error|null), response?: google.cloud.contactcenterinsights.v1.Issue) => void; + /** + * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|deleteIssue}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteIssueCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|calculateIssueModelStats}. * @param error Error, if any @@ -1236,6 +1299,9 @@ export namespace google { /** CreateAnalysisOperationMetadata conversation */ conversation?: (string|null); + + /** CreateAnalysisOperationMetadata annotatorSelector */ + annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); } /** Represents a CreateAnalysisOperationMetadata. */ @@ -1256,6 +1322,9 @@ export namespace google { /** CreateAnalysisOperationMetadata conversation. */ public conversation: string; + /** CreateAnalysisOperationMetadata annotatorSelector. */ + public annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); + /** * Creates a new CreateAnalysisOperationMetadata instance using the specified properties. * @param [properties] Properties to set @@ -1976,241 +2045,862 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateAnalysisRequest. */ - interface ICreateAnalysisRequest { + /** Properties of an IngestConversationsRequest. */ + interface IIngestConversationsRequest { - /** CreateAnalysisRequest parent */ + /** IngestConversationsRequest gcsSource */ + gcsSource?: (google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource|null); + + /** IngestConversationsRequest transcriptObjectConfig */ + transcriptObjectConfig?: (google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig|null); + + /** IngestConversationsRequest parent */ parent?: (string|null); - /** CreateAnalysisRequest analysis */ - analysis?: (google.cloud.contactcenterinsights.v1.IAnalysis|null); + /** IngestConversationsRequest conversationConfig */ + conversationConfig?: (google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig|null); } - /** Represents a CreateAnalysisRequest. */ - class CreateAnalysisRequest implements ICreateAnalysisRequest { + /** Represents an IngestConversationsRequest. */ + class IngestConversationsRequest implements IIngestConversationsRequest { /** - * Constructs a new CreateAnalysisRequest. + * Constructs a new IngestConversationsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest); + constructor(properties?: google.cloud.contactcenterinsights.v1.IIngestConversationsRequest); - /** CreateAnalysisRequest parent. */ + /** IngestConversationsRequest gcsSource. */ + public gcsSource?: (google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource|null); + + /** IngestConversationsRequest transcriptObjectConfig. */ + public transcriptObjectConfig?: (google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig|null); + + /** IngestConversationsRequest parent. */ public parent: string; - /** CreateAnalysisRequest analysis. */ - public analysis?: (google.cloud.contactcenterinsights.v1.IAnalysis|null); + /** IngestConversationsRequest conversationConfig. */ + public conversationConfig?: (google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig|null); + + /** IngestConversationsRequest source. */ + public source?: "gcsSource"; + + /** IngestConversationsRequest objectConfig. */ + public objectConfig?: "transcriptObjectConfig"; /** - * Creates a new CreateAnalysisRequest instance using the specified properties. + * Creates a new IngestConversationsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateAnalysisRequest instance + * @returns IngestConversationsRequest instance */ - public static create(properties?: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + public static create(properties?: google.cloud.contactcenterinsights.v1.IIngestConversationsRequest): google.cloud.contactcenterinsights.v1.IngestConversationsRequest; /** - * Encodes the specified CreateAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. - * @param message CreateAnalysisRequest message or plain object to encode + * Encodes the specified IngestConversationsRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.verify|verify} messages. + * @param message IngestConversationsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. - * @param message CreateAnalysisRequest message or plain object to encode + * Encodes the specified IngestConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.verify|verify} messages. + * @param message IngestConversationsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateAnalysisRequest message from the specified reader or buffer. + * Decodes an IngestConversationsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateAnalysisRequest + * @returns IngestConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IngestConversationsRequest; /** - * Decodes a CreateAnalysisRequest message from the specified reader or buffer, length delimited. + * Decodes an IngestConversationsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateAnalysisRequest + * @returns IngestConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IngestConversationsRequest; /** - * Verifies a CreateAnalysisRequest message. + * Verifies an IngestConversationsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * Creates an IngestConversationsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateAnalysisRequest + * @returns IngestConversationsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IngestConversationsRequest; /** - * Creates a plain object from a CreateAnalysisRequest message. Also converts values to other types if specified. - * @param message CreateAnalysisRequest + * Creates a plain object from an IngestConversationsRequest message. Also converts values to other types if specified. + * @param message IngestConversationsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.contactcenterinsights.v1.CreateAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateAnalysisRequest to JSON. + * Converts this IngestConversationsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateAnalysisRequest + * Gets the default type url for IngestConversationsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListAnalysesRequest. */ - interface IListAnalysesRequest { - - /** ListAnalysesRequest parent */ - parent?: (string|null); + namespace IngestConversationsRequest { - /** ListAnalysesRequest pageSize */ - pageSize?: (number|null); + /** Properties of a GcsSource. */ + interface IGcsSource { - /** ListAnalysesRequest pageToken */ - pageToken?: (string|null); + /** GcsSource bucketUri */ + bucketUri?: (string|null); + } - /** ListAnalysesRequest filter */ - filter?: (string|null); - } + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { - /** Represents a ListAnalysesRequest. */ - class ListAnalysesRequest implements IListAnalysesRequest { + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource); - /** - * Constructs a new ListAnalysesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.contactcenterinsights.v1.IListAnalysesRequest); + /** GcsSource bucketUri. */ + public bucketUri: string; - /** ListAnalysesRequest parent. */ - public parent: string; + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource; - /** ListAnalysesRequest pageSize. */ - public pageSize: number; + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListAnalysesRequest pageToken. */ - public pageToken: string; + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListAnalysesRequest filter. */ - public filter: string; + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource; - /** - * Creates a new ListAnalysesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAnalysesRequest instance - */ - public static create(properties?: google.cloud.contactcenterinsights.v1.IListAnalysesRequest): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource; - /** - * Encodes the specified ListAnalysesRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. - * @param message ListAnalysesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.contactcenterinsights.v1.IListAnalysesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified ListAnalysesRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. - * @param message ListAnalysesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IListAnalysesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource; - /** - * Decodes a ListAnalysesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAnalysesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a ListAnalysesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAnalysesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Verifies a ListAnalysesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a ListAnalysesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAnalysesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + /** Properties of a TranscriptObjectConfig. */ + interface ITranscriptObjectConfig { - /** - * Creates a plain object from a ListAnalysesRequest message. Also converts values to other types if specified. - * @param message ListAnalysesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.contactcenterinsights.v1.ListAnalysesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** TranscriptObjectConfig medium */ + medium?: (google.cloud.contactcenterinsights.v1.Conversation.Medium|keyof typeof google.cloud.contactcenterinsights.v1.Conversation.Medium|null); + } - /** - * Converts this ListAnalysesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a TranscriptObjectConfig. */ + class TranscriptObjectConfig implements ITranscriptObjectConfig { - /** - * Gets the default type url for ListAnalysesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Constructs a new TranscriptObjectConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig); - /** Properties of a ListAnalysesResponse. */ - interface IListAnalysesResponse { + /** TranscriptObjectConfig medium. */ + public medium: (google.cloud.contactcenterinsights.v1.Conversation.Medium|keyof typeof google.cloud.contactcenterinsights.v1.Conversation.Medium); - /** ListAnalysesResponse analyses */ - analyses?: (google.cloud.contactcenterinsights.v1.IAnalysis[]|null); + /** + * Creates a new TranscriptObjectConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptObjectConfig instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig; - /** ListAnalysesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * Encodes the specified TranscriptObjectConfig message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.verify|verify} messages. + * @param message TranscriptObjectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ListAnalysesResponse. */ - class ListAnalysesResponse implements IListAnalysesResponse { + /** + * Encodes the specified TranscriptObjectConfig message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.verify|verify} messages. + * @param message TranscriptObjectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ListAnalysesResponse. - * @param [properties] Properties to set - */ + /** + * Decodes a TranscriptObjectConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptObjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig; + + /** + * Decodes a TranscriptObjectConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptObjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig; + + /** + * Verifies a TranscriptObjectConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptObjectConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptObjectConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig; + + /** + * Creates a plain object from a TranscriptObjectConfig message. Also converts values to other types if specified. + * @param message TranscriptObjectConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptObjectConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptObjectConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConversationConfig. */ + interface IConversationConfig { + + /** ConversationConfig agentId */ + agentId?: (string|null); + } + + /** Represents a ConversationConfig. */ + class ConversationConfig implements IConversationConfig { + + /** + * Constructs a new ConversationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig); + + /** ConversationConfig agentId. */ + public agentId: string; + + /** + * Creates a new ConversationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationConfig instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig; + + /** + * Encodes the specified ConversationConfig message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.verify|verify} messages. + * @param message ConversationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationConfig message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.verify|verify} messages. + * @param message ConversationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig; + + /** + * Decodes a ConversationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig; + + /** + * Verifies a ConversationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig; + + /** + * Creates a plain object from a ConversationConfig message. Also converts values to other types if specified. + * @param message ConversationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConversationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IngestConversationsMetadata. */ + interface IIngestConversationsMetadata { + + /** IngestConversationsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** IngestConversationsMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** IngestConversationsMetadata request */ + request?: (google.cloud.contactcenterinsights.v1.IIngestConversationsRequest|null); + + /** IngestConversationsMetadata partialErrors */ + partialErrors?: (google.rpc.IStatus[]|null); + } + + /** Represents an IngestConversationsMetadata. */ + class IngestConversationsMetadata implements IIngestConversationsMetadata { + + /** + * Constructs a new IngestConversationsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata); + + /** IngestConversationsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** IngestConversationsMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** IngestConversationsMetadata request. */ + public request?: (google.cloud.contactcenterinsights.v1.IIngestConversationsRequest|null); + + /** IngestConversationsMetadata partialErrors. */ + public partialErrors: google.rpc.IStatus[]; + + /** + * Creates a new IngestConversationsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestConversationsMetadata instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata): google.cloud.contactcenterinsights.v1.IngestConversationsMetadata; + + /** + * Encodes the specified IngestConversationsMetadata message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.verify|verify} messages. + * @param message IngestConversationsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestConversationsMetadata message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.verify|verify} messages. + * @param message IngestConversationsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestConversationsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestConversationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IngestConversationsMetadata; + + /** + * Decodes an IngestConversationsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestConversationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IngestConversationsMetadata; + + /** + * Verifies an IngestConversationsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestConversationsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestConversationsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IngestConversationsMetadata; + + /** + * Creates a plain object from an IngestConversationsMetadata message. Also converts values to other types if specified. + * @param message IngestConversationsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.IngestConversationsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestConversationsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestConversationsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngestConversationsResponse. */ + interface IIngestConversationsResponse { + } + + /** Represents an IngestConversationsResponse. */ + class IngestConversationsResponse implements IIngestConversationsResponse { + + /** + * Constructs a new IngestConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IIngestConversationsResponse); + + /** + * Creates a new IngestConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns IngestConversationsResponse instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IIngestConversationsResponse): google.cloud.contactcenterinsights.v1.IngestConversationsResponse; + + /** + * Encodes the specified IngestConversationsResponse message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsResponse.verify|verify} messages. + * @param message IngestConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngestConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsResponse.verify|verify} messages. + * @param message IngestConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngestConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngestConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IngestConversationsResponse; + + /** + * Decodes an IngestConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngestConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IngestConversationsResponse; + + /** + * Verifies an IngestConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IngestConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngestConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IngestConversationsResponse; + + /** + * Creates a plain object from an IngestConversationsResponse message. Also converts values to other types if specified. + * @param message IngestConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.IngestConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngestConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngestConversationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAnalysisRequest. */ + interface ICreateAnalysisRequest { + + /** CreateAnalysisRequest parent */ + parent?: (string|null); + + /** CreateAnalysisRequest analysis */ + analysis?: (google.cloud.contactcenterinsights.v1.IAnalysis|null); + } + + /** Represents a CreateAnalysisRequest. */ + class CreateAnalysisRequest implements ICreateAnalysisRequest { + + /** + * Constructs a new CreateAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest); + + /** CreateAnalysisRequest parent. */ + public parent: string; + + /** CreateAnalysisRequest analysis. */ + public analysis?: (google.cloud.contactcenterinsights.v1.IAnalysis|null); + + /** + * Creates a new CreateAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAnalysisRequest instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + + /** + * Encodes the specified CreateAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. + * @param message CreateAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. + * @param message CreateAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + + /** + * Verifies a CreateAnalysisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.CreateAnalysisRequest; + + /** + * Creates a plain object from a CreateAnalysisRequest message. Also converts values to other types if specified. + * @param message CreateAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.CreateAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnalysesRequest. */ + interface IListAnalysesRequest { + + /** ListAnalysesRequest parent */ + parent?: (string|null); + + /** ListAnalysesRequest pageSize */ + pageSize?: (number|null); + + /** ListAnalysesRequest pageToken */ + pageToken?: (string|null); + + /** ListAnalysesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListAnalysesRequest. */ + class ListAnalysesRequest implements IListAnalysesRequest { + + /** + * Constructs a new ListAnalysesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IListAnalysesRequest); + + /** ListAnalysesRequest parent. */ + public parent: string; + + /** ListAnalysesRequest pageSize. */ + public pageSize: number; + + /** ListAnalysesRequest pageToken. */ + public pageToken: string; + + /** ListAnalysesRequest filter. */ + public filter: string; + + /** + * Creates a new ListAnalysesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnalysesRequest instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IListAnalysesRequest): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + + /** + * Encodes the specified ListAnalysesRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. + * @param message ListAnalysesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IListAnalysesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnalysesRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. + * @param message ListAnalysesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IListAnalysesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + + /** + * Verifies a ListAnalysesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnalysesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnalysesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.ListAnalysesRequest; + + /** + * Creates a plain object from a ListAnalysesRequest message. Also converts values to other types if specified. + * @param message ListAnalysesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.ListAnalysesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnalysesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAnalysesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAnalysesResponse. */ + interface IListAnalysesResponse { + + /** ListAnalysesResponse analyses */ + analyses?: (google.cloud.contactcenterinsights.v1.IAnalysis[]|null); + + /** ListAnalysesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAnalysesResponse. */ + class ListAnalysesResponse implements IListAnalysesResponse { + + /** + * Constructs a new ListAnalysesResponse. + * @param [properties] Properties to set + */ constructor(properties?: google.cloud.contactcenterinsights.v1.IListAnalysesResponse); /** ListAnalysesResponse analyses. */ @@ -2373,118 +3063,463 @@ export namespace google { public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.GetAnalysisRequest; /** - * Creates a plain object from a GetAnalysisRequest message. Also converts values to other types if specified. - * @param message GetAnalysisRequest + * Creates a plain object from a GetAnalysisRequest message. Also converts values to other types if specified. + * @param message GetAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.GetAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAnalysisRequest. */ + interface IDeleteAnalysisRequest { + + /** DeleteAnalysisRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAnalysisRequest. */ + class DeleteAnalysisRequest implements IDeleteAnalysisRequest { + + /** + * Constructs a new DeleteAnalysisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest); + + /** DeleteAnalysisRequest name. */ + public name: string; + + /** + * Creates a new DeleteAnalysisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAnalysisRequest instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + + /** + * Encodes the specified DeleteAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. + * @param message DeleteAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. + * @param message DeleteAnalysisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + + /** + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + + /** + * Verifies a DeleteAnalysisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAnalysisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + + /** + * Creates a plain object from a DeleteAnalysisRequest message. Also converts values to other types if specified. + * @param message DeleteAnalysisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAnalysisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAnalysisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BulkAnalyzeConversationsRequest. */ + interface IBulkAnalyzeConversationsRequest { + + /** BulkAnalyzeConversationsRequest parent */ + parent?: (string|null); + + /** BulkAnalyzeConversationsRequest filter */ + filter?: (string|null); + + /** BulkAnalyzeConversationsRequest analysisPercentage */ + analysisPercentage?: (number|null); + + /** BulkAnalyzeConversationsRequest annotatorSelector */ + annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); + } + + /** Represents a BulkAnalyzeConversationsRequest. */ + class BulkAnalyzeConversationsRequest implements IBulkAnalyzeConversationsRequest { + + /** + * Constructs a new BulkAnalyzeConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest); + + /** BulkAnalyzeConversationsRequest parent. */ + public parent: string; + + /** BulkAnalyzeConversationsRequest filter. */ + public filter: string; + + /** BulkAnalyzeConversationsRequest analysisPercentage. */ + public analysisPercentage: number; + + /** BulkAnalyzeConversationsRequest annotatorSelector. */ + public annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); + + /** + * Creates a new BulkAnalyzeConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkAnalyzeConversationsRequest instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest; + + /** + * Encodes the specified BulkAnalyzeConversationsRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.verify|verify} messages. + * @param message BulkAnalyzeConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkAnalyzeConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.verify|verify} messages. + * @param message BulkAnalyzeConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkAnalyzeConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkAnalyzeConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest; + + /** + * Decodes a BulkAnalyzeConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkAnalyzeConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest; + + /** + * Verifies a BulkAnalyzeConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkAnalyzeConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkAnalyzeConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest; + + /** + * Creates a plain object from a BulkAnalyzeConversationsRequest message. Also converts values to other types if specified. + * @param message BulkAnalyzeConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkAnalyzeConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BulkAnalyzeConversationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BulkAnalyzeConversationsMetadata. */ + interface IBulkAnalyzeConversationsMetadata { + + /** BulkAnalyzeConversationsMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BulkAnalyzeConversationsMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** BulkAnalyzeConversationsMetadata request */ + request?: (google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest|null); + + /** BulkAnalyzeConversationsMetadata completedAnalysesCount */ + completedAnalysesCount?: (number|null); + + /** BulkAnalyzeConversationsMetadata failedAnalysesCount */ + failedAnalysesCount?: (number|null); + + /** BulkAnalyzeConversationsMetadata totalRequestedAnalysesCount */ + totalRequestedAnalysesCount?: (number|null); + } + + /** Represents a BulkAnalyzeConversationsMetadata. */ + class BulkAnalyzeConversationsMetadata implements IBulkAnalyzeConversationsMetadata { + + /** + * Constructs a new BulkAnalyzeConversationsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata); + + /** BulkAnalyzeConversationsMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BulkAnalyzeConversationsMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** BulkAnalyzeConversationsMetadata request. */ + public request?: (google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest|null); + + /** BulkAnalyzeConversationsMetadata completedAnalysesCount. */ + public completedAnalysesCount: number; + + /** BulkAnalyzeConversationsMetadata failedAnalysesCount. */ + public failedAnalysesCount: number; + + /** BulkAnalyzeConversationsMetadata totalRequestedAnalysesCount. */ + public totalRequestedAnalysesCount: number; + + /** + * Creates a new BulkAnalyzeConversationsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkAnalyzeConversationsMetadata instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata; + + /** + * Encodes the specified BulkAnalyzeConversationsMetadata message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.verify|verify} messages. + * @param message BulkAnalyzeConversationsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkAnalyzeConversationsMetadata message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.verify|verify} messages. + * @param message BulkAnalyzeConversationsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkAnalyzeConversationsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkAnalyzeConversationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata; + + /** + * Decodes a BulkAnalyzeConversationsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkAnalyzeConversationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata; + + /** + * Verifies a BulkAnalyzeConversationsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkAnalyzeConversationsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkAnalyzeConversationsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata; + + /** + * Creates a plain object from a BulkAnalyzeConversationsMetadata message. Also converts values to other types if specified. + * @param message BulkAnalyzeConversationsMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.contactcenterinsights.v1.GetAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetAnalysisRequest to JSON. + * Converts this BulkAnalyzeConversationsMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetAnalysisRequest + * Gets the default type url for BulkAnalyzeConversationsMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteAnalysisRequest. */ - interface IDeleteAnalysisRequest { + /** Properties of a BulkAnalyzeConversationsResponse. */ + interface IBulkAnalyzeConversationsResponse { - /** DeleteAnalysisRequest name */ - name?: (string|null); + /** BulkAnalyzeConversationsResponse successfulAnalysisCount */ + successfulAnalysisCount?: (number|null); + + /** BulkAnalyzeConversationsResponse failedAnalysisCount */ + failedAnalysisCount?: (number|null); } - /** Represents a DeleteAnalysisRequest. */ - class DeleteAnalysisRequest implements IDeleteAnalysisRequest { + /** Represents a BulkAnalyzeConversationsResponse. */ + class BulkAnalyzeConversationsResponse implements IBulkAnalyzeConversationsResponse { /** - * Constructs a new DeleteAnalysisRequest. + * Constructs a new BulkAnalyzeConversationsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest); + constructor(properties?: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse); - /** DeleteAnalysisRequest name. */ - public name: string; + /** BulkAnalyzeConversationsResponse successfulAnalysisCount. */ + public successfulAnalysisCount: number; + + /** BulkAnalyzeConversationsResponse failedAnalysisCount. */ + public failedAnalysisCount: number; /** - * Creates a new DeleteAnalysisRequest instance using the specified properties. + * Creates a new BulkAnalyzeConversationsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteAnalysisRequest instance + * @returns BulkAnalyzeConversationsResponse instance */ - public static create(properties?: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + public static create(properties?: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse; /** - * Encodes the specified DeleteAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. - * @param message DeleteAnalysisRequest message or plain object to encode + * Encodes the specified BulkAnalyzeConversationsResponse message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse.verify|verify} messages. + * @param message BulkAnalyzeConversationsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. - * @param message DeleteAnalysisRequest message or plain object to encode + * Encodes the specified BulkAnalyzeConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse.verify|verify} messages. + * @param message BulkAnalyzeConversationsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteAnalysisRequest message from the specified reader or buffer. + * Decodes a BulkAnalyzeConversationsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteAnalysisRequest + * @returns BulkAnalyzeConversationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse; /** - * Decodes a DeleteAnalysisRequest message from the specified reader or buffer, length delimited. + * Decodes a BulkAnalyzeConversationsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteAnalysisRequest + * @returns BulkAnalyzeConversationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse; /** - * Verifies a DeleteAnalysisRequest message. + * Verifies a BulkAnalyzeConversationsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BulkAnalyzeConversationsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteAnalysisRequest + * @returns BulkAnalyzeConversationsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse; /** - * Creates a plain object from a DeleteAnalysisRequest message. Also converts values to other types if specified. - * @param message DeleteAnalysisRequest + * Creates a plain object from a BulkAnalyzeConversationsResponse message. Also converts values to other types if specified. + * @param message BulkAnalyzeConversationsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteAnalysisRequest to JSON. + * Converts this BulkAnalyzeConversationsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteAnalysisRequest + * Gets the default type url for BulkAnalyzeConversationsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -4740,6 +5775,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DeleteIssueRequest. */ + interface IDeleteIssueRequest { + + /** DeleteIssueRequest name */ + name?: (string|null); + } + + /** Represents a DeleteIssueRequest. */ + class DeleteIssueRequest implements IDeleteIssueRequest { + + /** + * Constructs a new DeleteIssueRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IDeleteIssueRequest); + + /** DeleteIssueRequest name. */ + public name: string; + + /** + * Creates a new DeleteIssueRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteIssueRequest instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IDeleteIssueRequest): google.cloud.contactcenterinsights.v1.DeleteIssueRequest; + + /** + * Encodes the specified DeleteIssueRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteIssueRequest.verify|verify} messages. + * @param message DeleteIssueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteIssueRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteIssueRequest.verify|verify} messages. + * @param message DeleteIssueRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteIssueRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteIssueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.DeleteIssueRequest; + + /** + * Decodes a DeleteIssueRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteIssueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.DeleteIssueRequest; + + /** + * Verifies a DeleteIssueRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteIssueRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteIssueRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.DeleteIssueRequest; + + /** + * Creates a plain object from a DeleteIssueRequest message. Also converts values to other types if specified. + * @param message DeleteIssueRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.DeleteIssueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteIssueRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteIssueRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CalculateIssueModelStatsRequest. */ interface ICalculateIssueModelStatsRequest { @@ -7162,6 +8294,9 @@ export namespace google { /** Analysis analysisResult */ analysisResult?: (google.cloud.contactcenterinsights.v1.IAnalysisResult|null); + + /** Analysis annotatorSelector */ + annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); } /** Represents an Analysis. */ @@ -7185,6 +8320,9 @@ export namespace google { /** Analysis analysisResult. */ public analysisResult?: (google.cloud.contactcenterinsights.v1.IAnalysisResult|null); + /** Analysis annotatorSelector. */ + public annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); + /** * Creates a new Analysis instance using the specified properties. * @param [properties] Properties to set @@ -8150,6 +9288,9 @@ export namespace google { /** CallAnnotation phraseMatchData */ phraseMatchData?: (google.cloud.contactcenterinsights.v1.IPhraseMatchData|null); + /** CallAnnotation issueMatchData */ + issueMatchData?: (google.cloud.contactcenterinsights.v1.IIssueMatchData|null); + /** CallAnnotation channelTag */ channelTag?: (number|null); @@ -8190,6 +9331,9 @@ export namespace google { /** CallAnnotation phraseMatchData. */ public phraseMatchData?: (google.cloud.contactcenterinsights.v1.IPhraseMatchData|null); + /** CallAnnotation issueMatchData. */ + public issueMatchData?: (google.cloud.contactcenterinsights.v1.IIssueMatchData|null); + /** CallAnnotation channelTag. */ public channelTag: number; @@ -8200,7 +9344,7 @@ export namespace google { public annotationEndBoundary?: (google.cloud.contactcenterinsights.v1.IAnnotationBoundary|null); /** CallAnnotation data. */ - public data?: ("interruptionData"|"sentimentData"|"silenceData"|"holdData"|"entityMentionData"|"intentMatchData"|"phraseMatchData"); + public data?: ("interruptionData"|"sentimentData"|"silenceData"|"holdData"|"entityMentionData"|"intentMatchData"|"phraseMatchData"|"issueMatchData"); /** * Creates a new CallAnnotation instance using the specified properties. @@ -9422,6 +10566,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an IssueMatchData. */ + interface IIssueMatchData { + + /** IssueMatchData issueAssignment */ + issueAssignment?: (google.cloud.contactcenterinsights.v1.IIssueAssignment|null); + } + + /** Represents an IssueMatchData. */ + class IssueMatchData implements IIssueMatchData { + + /** + * Constructs a new IssueMatchData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IIssueMatchData); + + /** IssueMatchData issueAssignment. */ + public issueAssignment?: (google.cloud.contactcenterinsights.v1.IIssueAssignment|null); + + /** + * Creates a new IssueMatchData instance using the specified properties. + * @param [properties] Properties to set + * @returns IssueMatchData instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IIssueMatchData): google.cloud.contactcenterinsights.v1.IssueMatchData; + + /** + * Encodes the specified IssueMatchData message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IssueMatchData.verify|verify} messages. + * @param message IssueMatchData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IIssueMatchData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IssueMatchData message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IssueMatchData.verify|verify} messages. + * @param message IssueMatchData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IIssueMatchData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IssueMatchData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IssueMatchData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.IssueMatchData; + + /** + * Decodes an IssueMatchData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IssueMatchData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.IssueMatchData; + + /** + * Verifies an IssueMatchData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IssueMatchData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IssueMatchData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.IssueMatchData; + + /** + * Creates a plain object from an IssueMatchData message. Also converts values to other types if specified. + * @param message IssueMatchData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.IssueMatchData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IssueMatchData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IssueMatchData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an IssueModel. */ interface IIssueModel { @@ -9691,6 +10932,9 @@ export namespace google { /** Issue updateTime */ updateTime?: (google.protobuf.ITimestamp|null); + + /** Issue sampleUtterances */ + sampleUtterances?: (string[]|null); } /** Represents an Issue. */ @@ -9714,6 +10958,9 @@ export namespace google { /** Issue updateTime. */ public updateTime?: (google.protobuf.ITimestamp|null); + /** Issue sampleUtterances. */ + public sampleUtterances: string[]; + /** * Creates a new Issue instance using the specified properties. * @param [properties] Properties to set @@ -10739,6 +11986,9 @@ export namespace google { /** AnalysisConfig runtimeIntegrationAnalysisPercentage */ runtimeIntegrationAnalysisPercentage?: (number|null); + + /** AnalysisConfig annotatorSelector */ + annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); } /** Represents an AnalysisConfig. */ @@ -10753,6 +12003,9 @@ export namespace google { /** AnalysisConfig runtimeIntegrationAnalysisPercentage. */ public runtimeIntegrationAnalysisPercentage: number; + /** AnalysisConfig annotatorSelector. */ + public annotatorSelector?: (google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null); + /** * Creates a new AnalysisConfig instance using the specified properties. * @param [properties] Properties to set @@ -11949,6 +13202,151 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an AnnotatorSelector. */ + interface IAnnotatorSelector { + + /** AnnotatorSelector runInterruptionAnnotator */ + runInterruptionAnnotator?: (boolean|null); + + /** AnnotatorSelector runSilenceAnnotator */ + runSilenceAnnotator?: (boolean|null); + + /** AnnotatorSelector runPhraseMatcherAnnotator */ + runPhraseMatcherAnnotator?: (boolean|null); + + /** AnnotatorSelector phraseMatchers */ + phraseMatchers?: (string[]|null); + + /** AnnotatorSelector runSentimentAnnotator */ + runSentimentAnnotator?: (boolean|null); + + /** AnnotatorSelector runEntityAnnotator */ + runEntityAnnotator?: (boolean|null); + + /** AnnotatorSelector runIntentAnnotator */ + runIntentAnnotator?: (boolean|null); + + /** AnnotatorSelector runIssueModelAnnotator */ + runIssueModelAnnotator?: (boolean|null); + + /** AnnotatorSelector issueModels */ + issueModels?: (string[]|null); + } + + /** Represents an AnnotatorSelector. */ + class AnnotatorSelector implements IAnnotatorSelector { + + /** + * Constructs a new AnnotatorSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.contactcenterinsights.v1.IAnnotatorSelector); + + /** AnnotatorSelector runInterruptionAnnotator. */ + public runInterruptionAnnotator: boolean; + + /** AnnotatorSelector runSilenceAnnotator. */ + public runSilenceAnnotator: boolean; + + /** AnnotatorSelector runPhraseMatcherAnnotator. */ + public runPhraseMatcherAnnotator: boolean; + + /** AnnotatorSelector phraseMatchers. */ + public phraseMatchers: string[]; + + /** AnnotatorSelector runSentimentAnnotator. */ + public runSentimentAnnotator: boolean; + + /** AnnotatorSelector runEntityAnnotator. */ + public runEntityAnnotator: boolean; + + /** AnnotatorSelector runIntentAnnotator. */ + public runIntentAnnotator: boolean; + + /** AnnotatorSelector runIssueModelAnnotator. */ + public runIssueModelAnnotator: boolean; + + /** AnnotatorSelector issueModels. */ + public issueModels: string[]; + + /** + * Creates a new AnnotatorSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatorSelector instance + */ + public static create(properties?: google.cloud.contactcenterinsights.v1.IAnnotatorSelector): google.cloud.contactcenterinsights.v1.AnnotatorSelector; + + /** + * Encodes the specified AnnotatorSelector message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify|verify} messages. + * @param message AnnotatorSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.contactcenterinsights.v1.IAnnotatorSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatorSelector message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify|verify} messages. + * @param message AnnotatorSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.contactcenterinsights.v1.IAnnotatorSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatorSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatorSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.contactcenterinsights.v1.AnnotatorSelector; + + /** + * Decodes an AnnotatorSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatorSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.contactcenterinsights.v1.AnnotatorSelector; + + /** + * Verifies an AnnotatorSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnnotatorSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatorSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.contactcenterinsights.v1.AnnotatorSelector; + + /** + * Creates a plain object from an AnnotatorSelector message. Also converts values to other types if specified. + * @param message AnnotatorSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.contactcenterinsights.v1.AnnotatorSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatorSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotatorSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } } diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.js b/packages/google-cloud-contactcenterinsights/protos/protos.js index 4cd9d71c172..f8b48675e96 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.js +++ b/packages/google-cloud-contactcenterinsights/protos/protos.js @@ -395,6 +395,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|bulkAnalyzeConversations}. + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @typedef BulkAnalyzeConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BulkAnalyzeConversations. + * @function bulkAnalyzeConversations + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @instance + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest} request BulkAnalyzeConversationsRequest message or plain object + * @param {google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContactCenterInsights.prototype.bulkAnalyzeConversations = function bulkAnalyzeConversations(request, callback) { + return this.rpcCall(bulkAnalyzeConversations, $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BulkAnalyzeConversations" }); + + /** + * Calls BulkAnalyzeConversations. + * @function bulkAnalyzeConversations + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @instance + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest} request BulkAnalyzeConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|ingestConversations}. + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @typedef IngestConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls IngestConversations. + * @function ingestConversations + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @instance + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest} request IngestConversationsRequest message or plain object + * @param {google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversationsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContactCenterInsights.prototype.ingestConversations = function ingestConversations(request, callback) { + return this.rpcCall(ingestConversations, $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "IngestConversations" }); + + /** + * Calls IngestConversations. + * @function ingestConversations + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @instance + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest} request IngestConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|exportInsightsData}. * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights @@ -758,6 +824,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|deleteIssue}. + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @typedef DeleteIssueCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteIssue. + * @function deleteIssue + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @instance + * @param {google.cloud.contactcenterinsights.v1.IDeleteIssueRequest} request DeleteIssueRequest message or plain object + * @param {google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssueCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ContactCenterInsights.prototype.deleteIssue = function deleteIssue(request, callback) { + return this.rpcCall(deleteIssue, $root.google.cloud.contactcenterinsights.v1.DeleteIssueRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteIssue" }); + + /** + * Calls DeleteIssue. + * @function deleteIssue + * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights + * @instance + * @param {google.cloud.contactcenterinsights.v1.IDeleteIssueRequest} request DeleteIssueRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.contactcenterinsights.v1.ContactCenterInsights|calculateIssueModelStats}. * @memberof google.cloud.contactcenterinsights.v1.ContactCenterInsights @@ -2481,6 +2580,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] CreateAnalysisOperationMetadata createTime * @property {google.protobuf.ITimestamp|null} [endTime] CreateAnalysisOperationMetadata endTime * @property {string|null} [conversation] CreateAnalysisOperationMetadata conversation + * @property {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null} [annotatorSelector] CreateAnalysisOperationMetadata annotatorSelector */ /** @@ -2522,6 +2622,14 @@ */ CreateAnalysisOperationMetadata.prototype.conversation = ""; + /** + * CreateAnalysisOperationMetadata annotatorSelector. + * @member {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null|undefined} annotatorSelector + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata + * @instance + */ + CreateAnalysisOperationMetadata.prototype.annotatorSelector = null; + /** * Creates a new CreateAnalysisOperationMetadata instance using the specified properties. * @function create @@ -2552,6 +2660,8 @@ $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.conversation); + if (message.annotatorSelector != null && Object.hasOwnProperty.call(message, "annotatorSelector")) + $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.encode(message.annotatorSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -2598,6 +2708,10 @@ message.conversation = reader.string(); break; } + case 4: { + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2646,6 +2760,11 @@ if (message.conversation != null && message.hasOwnProperty("conversation")) if (!$util.isString(message.conversation)) return "conversation: string expected"; + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) { + var error = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify(message.annotatorSelector); + if (error) + return "annotatorSelector." + error; + } return null; }; @@ -2673,6 +2792,11 @@ } if (object.conversation != null) message.conversation = String(object.conversation); + if (object.annotatorSelector != null) { + if (typeof object.annotatorSelector !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata.annotatorSelector: object expected"); + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.fromObject(object.annotatorSelector); + } return message; }; @@ -2693,6 +2817,7 @@ object.createTime = null; object.endTime = null; object.conversation = ""; + object.annotatorSelector = null; } if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); @@ -2700,6 +2825,8 @@ object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); if (message.conversation != null && message.hasOwnProperty("conversation")) object.conversation = message.conversation; + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) + object.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.toObject(message.annotatorSelector, options); return object; }; @@ -4270,25 +4397,27 @@ return DeleteConversationRequest; })(); - v1.CreateAnalysisRequest = (function() { + v1.IngestConversationsRequest = (function() { /** - * Properties of a CreateAnalysisRequest. + * Properties of an IngestConversationsRequest. * @memberof google.cloud.contactcenterinsights.v1 - * @interface ICreateAnalysisRequest - * @property {string|null} [parent] CreateAnalysisRequest parent - * @property {google.cloud.contactcenterinsights.v1.IAnalysis|null} [analysis] CreateAnalysisRequest analysis + * @interface IIngestConversationsRequest + * @property {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource|null} [gcsSource] IngestConversationsRequest gcsSource + * @property {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig|null} [transcriptObjectConfig] IngestConversationsRequest transcriptObjectConfig + * @property {string|null} [parent] IngestConversationsRequest parent + * @property {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig|null} [conversationConfig] IngestConversationsRequest conversationConfig */ /** - * Constructs a new CreateAnalysisRequest. + * Constructs a new IngestConversationsRequest. * @memberof google.cloud.contactcenterinsights.v1 - * @classdesc Represents a CreateAnalysisRequest. - * @implements ICreateAnalysisRequest + * @classdesc Represents an IngestConversationsRequest. + * @implements IIngestConversationsRequest * @constructor - * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest=} [properties] Properties to set + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest=} [properties] Properties to set */ - function CreateAnalysisRequest(properties) { + function IngestConversationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4296,89 +4425,142 @@ } /** - * CreateAnalysisRequest parent. + * IngestConversationsRequest gcsSource. + * @member {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @instance + */ + IngestConversationsRequest.prototype.gcsSource = null; + + /** + * IngestConversationsRequest transcriptObjectConfig. + * @member {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig|null|undefined} transcriptObjectConfig + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @instance + */ + IngestConversationsRequest.prototype.transcriptObjectConfig = null; + + /** + * IngestConversationsRequest parent. * @member {string} parent - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @instance */ - CreateAnalysisRequest.prototype.parent = ""; + IngestConversationsRequest.prototype.parent = ""; /** - * CreateAnalysisRequest analysis. - * @member {google.cloud.contactcenterinsights.v1.IAnalysis|null|undefined} analysis - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * IngestConversationsRequest conversationConfig. + * @member {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig|null|undefined} conversationConfig + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @instance */ - CreateAnalysisRequest.prototype.analysis = null; + IngestConversationsRequest.prototype.conversationConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new CreateAnalysisRequest instance using the specified properties. + * IngestConversationsRequest source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @instance + */ + Object.defineProperty(IngestConversationsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * IngestConversationsRequest objectConfig. + * @member {"transcriptObjectConfig"|undefined} objectConfig + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @instance + */ + Object.defineProperty(IngestConversationsRequest.prototype, "objectConfig", { + get: $util.oneOfGetter($oneOfFields = ["transcriptObjectConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngestConversationsRequest instance using the specified properties. * @function create - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest=} [properties] Properties to set - * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest instance + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest} IngestConversationsRequest instance */ - CreateAnalysisRequest.create = function create(properties) { - return new CreateAnalysisRequest(properties); + IngestConversationsRequest.create = function create(properties) { + return new IngestConversationsRequest(properties); }; /** - * Encodes the specified CreateAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. + * Encodes the specified IngestConversationsRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest} message CreateAnalysisRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest} message IngestConversationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateAnalysisRequest.encode = function encode(message, writer) { + IngestConversationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.analysis != null && Object.hasOwnProperty.call(message, "analysis")) - $root.google.cloud.contactcenterinsights.v1.Analysis.encode(message.analysis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.transcriptObjectConfig != null && Object.hasOwnProperty.call(message, "transcriptObjectConfig")) + $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.encode(message.transcriptObjectConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.conversationConfig != null && Object.hasOwnProperty.call(message, "conversationConfig")) + $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.encode(message.conversationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. + * Encodes the specified IngestConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest} message CreateAnalysisRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest} message IngestConversationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + IngestConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateAnalysisRequest message from the specified reader or buffer. + * Decodes an IngestConversationsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest} IngestConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateAnalysisRequest.decode = function decode(reader, length) { + IngestConversationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 2: { + message.gcsSource = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.transcriptObjectConfig = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.decode(reader, reader.uint32()); + break; + } case 1: { message.parent = reader.string(); break; } - case 2: { - message.analysis = $root.google.cloud.contactcenterinsights.v1.Analysis.decode(reader, reader.uint32()); + case 4: { + message.conversationConfig = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.decode(reader, reader.uint32()); break; } default: @@ -4390,257 +4572,2323 @@ }; /** - * Decodes a CreateAnalysisRequest message from the specified reader or buffer, length delimited. + * Decodes an IngestConversationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest} IngestConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + IngestConversationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateAnalysisRequest message. + * Verifies an IngestConversationsRequest message. * @function verify - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateAnalysisRequest.verify = function verify(message) { + IngestConversationsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.transcriptObjectConfig != null && message.hasOwnProperty("transcriptObjectConfig")) { + properties.objectConfig = 1; + { + var error = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.verify(message.transcriptObjectConfig); + if (error) + return "transcriptObjectConfig." + error; + } + } if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.analysis != null && message.hasOwnProperty("analysis")) { - var error = $root.google.cloud.contactcenterinsights.v1.Analysis.verify(message.analysis); + if (message.conversationConfig != null && message.hasOwnProperty("conversationConfig")) { + var error = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.verify(message.conversationConfig); if (error) - return "analysis." + error; + return "conversationConfig." + error; } return null; }; /** - * Creates a CreateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * Creates an IngestConversationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest} IngestConversationsRequest */ - CreateAnalysisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest) + IngestConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest) return object; - var message = new $root.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest(); + var message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.fromObject(object.gcsSource); + } + if (object.transcriptObjectConfig != null) { + if (typeof object.transcriptObjectConfig !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.transcriptObjectConfig: object expected"); + message.transcriptObjectConfig = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.fromObject(object.transcriptObjectConfig); + } if (object.parent != null) message.parent = String(object.parent); - if (object.analysis != null) { - if (typeof object.analysis !== "object") - throw TypeError(".google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.analysis: object expected"); - message.analysis = $root.google.cloud.contactcenterinsights.v1.Analysis.fromObject(object.analysis); + if (object.conversationConfig != null) { + if (typeof object.conversationConfig !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.conversationConfig: object expected"); + message.conversationConfig = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.fromObject(object.conversationConfig); } return message; }; /** - * Creates a plain object from a CreateAnalysisRequest message. Also converts values to other types if specified. + * Creates a plain object from an IngestConversationsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} message CreateAnalysisRequest + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest} message IngestConversationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateAnalysisRequest.toObject = function toObject(message, options) { + IngestConversationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.analysis = null; + object.conversationConfig = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.analysis != null && message.hasOwnProperty("analysis")) - object.analysis = $root.google.cloud.contactcenterinsights.v1.Analysis.toObject(message.analysis, options); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.transcriptObjectConfig != null && message.hasOwnProperty("transcriptObjectConfig")) { + object.transcriptObjectConfig = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.toObject(message.transcriptObjectConfig, options); + if (options.oneofs) + object.objectConfig = "transcriptObjectConfig"; + } + if (message.conversationConfig != null && message.hasOwnProperty("conversationConfig")) + object.conversationConfig = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.toObject(message.conversationConfig, options); return object; }; /** - * Converts this CreateAnalysisRequest to JSON. + * Converts this IngestConversationsRequest to JSON. * @function toJSON - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @instance * @returns {Object.} JSON object */ - CreateAnalysisRequest.prototype.toJSON = function toJSON() { + IngestConversationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateAnalysisRequest + * Gets the default type url for IngestConversationsRequest * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IngestConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.CreateAnalysisRequest"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IngestConversationsRequest"; }; - return CreateAnalysisRequest; - })(); + IngestConversationsRequest.GcsSource = (function() { - v1.ListAnalysesRequest = (function() { + /** + * Properties of a GcsSource. + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @interface IGcsSource + * @property {string|null} [bucketUri] GcsSource bucketUri + */ - /** - * Properties of a ListAnalysesRequest. - * @memberof google.cloud.contactcenterinsights.v1 - * @interface IListAnalysesRequest - * @property {string|null} [parent] ListAnalysesRequest parent - * @property {number|null} [pageSize] ListAnalysesRequest pageSize - * @property {string|null} [pageToken] ListAnalysesRequest pageToken - * @property {string|null} [filter] ListAnalysesRequest filter - */ + /** + * Constructs a new GcsSource. + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ListAnalysesRequest. - * @memberof google.cloud.contactcenterinsights.v1 - * @classdesc Represents a ListAnalysesRequest. - * @implements IListAnalysesRequest - * @constructor - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest=} [properties] Properties to set - */ - function ListAnalysesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * GcsSource bucketUri. + * @member {string} bucketUri + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @instance + */ + GcsSource.prototype.bucketUri = ""; - /** - * ListAnalysesRequest parent. - * @member {string} parent - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest - * @instance - */ - ListAnalysesRequest.prototype.parent = ""; + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; - /** - * ListAnalysesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketUri != null && Object.hasOwnProperty.call(message, "bucketUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucketUri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucketUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucketUri != null && message.hasOwnProperty("bucketUri")) + if (!$util.isString(message.bucketUri)) + return "bucketUri: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource(); + if (object.bucketUri != null) + message.bucketUri = String(object.bucketUri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bucketUri = ""; + if (message.bucketUri != null && message.hasOwnProperty("bucketUri")) + object.bucketUri = message.bucketUri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource"; + }; + + return GcsSource; + })(); + + IngestConversationsRequest.TranscriptObjectConfig = (function() { + + /** + * Properties of a TranscriptObjectConfig. + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @interface ITranscriptObjectConfig + * @property {google.cloud.contactcenterinsights.v1.Conversation.Medium|null} [medium] TranscriptObjectConfig medium + */ + + /** + * Constructs a new TranscriptObjectConfig. + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @classdesc Represents a TranscriptObjectConfig. + * @implements ITranscriptObjectConfig + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig=} [properties] Properties to set + */ + function TranscriptObjectConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptObjectConfig medium. + * @member {google.cloud.contactcenterinsights.v1.Conversation.Medium} medium + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @instance + */ + TranscriptObjectConfig.prototype.medium = 0; + + /** + * Creates a new TranscriptObjectConfig instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} TranscriptObjectConfig instance + */ + TranscriptObjectConfig.create = function create(properties) { + return new TranscriptObjectConfig(properties); + }; + + /** + * Encodes the specified TranscriptObjectConfig message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig} message TranscriptObjectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptObjectConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.medium != null && Object.hasOwnProperty.call(message, "medium")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.medium); + return writer; + }; + + /** + * Encodes the specified TranscriptObjectConfig message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ITranscriptObjectConfig} message TranscriptObjectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptObjectConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptObjectConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} TranscriptObjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptObjectConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.medium = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptObjectConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} TranscriptObjectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptObjectConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptObjectConfig message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptObjectConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.medium != null && message.hasOwnProperty("medium")) + switch (message.medium) { + default: + return "medium: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TranscriptObjectConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} TranscriptObjectConfig + */ + TranscriptObjectConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig(); + switch (object.medium) { + default: + if (typeof object.medium === "number") { + message.medium = object.medium; + break; + } + break; + case "MEDIUM_UNSPECIFIED": + case 0: + message.medium = 0; + break; + case "PHONE_CALL": + case 1: + message.medium = 1; + break; + case "CHAT": + case 2: + message.medium = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TranscriptObjectConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} message TranscriptObjectConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptObjectConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.medium = options.enums === String ? "MEDIUM_UNSPECIFIED" : 0; + if (message.medium != null && message.hasOwnProperty("medium")) + object.medium = options.enums === String ? $root.google.cloud.contactcenterinsights.v1.Conversation.Medium[message.medium] === undefined ? message.medium : $root.google.cloud.contactcenterinsights.v1.Conversation.Medium[message.medium] : message.medium; + return object; + }; + + /** + * Converts this TranscriptObjectConfig to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @instance + * @returns {Object.} JSON object + */ + TranscriptObjectConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptObjectConfig + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptObjectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig"; + }; + + return TranscriptObjectConfig; + })(); + + IngestConversationsRequest.ConversationConfig = (function() { + + /** + * Properties of a ConversationConfig. + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @interface IConversationConfig + * @property {string|null} [agentId] ConversationConfig agentId + */ + + /** + * Constructs a new ConversationConfig. + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest + * @classdesc Represents a ConversationConfig. + * @implements IConversationConfig + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig=} [properties] Properties to set + */ + function ConversationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConversationConfig agentId. + * @member {string} agentId + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @instance + */ + ConversationConfig.prototype.agentId = ""; + + /** + * Creates a new ConversationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} ConversationConfig instance + */ + ConversationConfig.create = function create(properties) { + return new ConversationConfig(properties); + }; + + /** + * Encodes the specified ConversationConfig message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig} message ConversationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agentId != null && Object.hasOwnProperty.call(message, "agentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agentId); + return writer; + }; + + /** + * Encodes the specified ConversationConfig message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.IConversationConfig} message ConversationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} ConversationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.agentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} ConversationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationConfig message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agentId != null && message.hasOwnProperty("agentId")) + if (!$util.isString(message.agentId)) + return "agentId: string expected"; + return null; + }; + + /** + * Creates a ConversationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} ConversationConfig + */ + ConversationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig(); + if (object.agentId != null) + message.agentId = String(object.agentId); + return message; + }; + + /** + * Creates a plain object from a ConversationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} message ConversationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agentId = ""; + if (message.agentId != null && message.hasOwnProperty("agentId")) + object.agentId = message.agentId; + return object; + }; + + /** + * Converts this ConversationConfig to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @instance + * @returns {Object.} JSON object + */ + ConversationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConversationConfig + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConversationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig"; + }; + + return ConversationConfig; + })(); + + return IngestConversationsRequest; + })(); + + v1.IngestConversationsMetadata = (function() { + + /** + * Properties of an IngestConversationsMetadata. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IIngestConversationsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] IngestConversationsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] IngestConversationsMetadata endTime + * @property {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest|null} [request] IngestConversationsMetadata request + * @property {Array.|null} [partialErrors] IngestConversationsMetadata partialErrors + */ + + /** + * Constructs a new IngestConversationsMetadata. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents an IngestConversationsMetadata. + * @implements IIngestConversationsMetadata + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata=} [properties] Properties to set + */ + function IngestConversationsMetadata(properties) { + this.partialErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IngestConversationsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @instance + */ + IngestConversationsMetadata.prototype.createTime = null; + + /** + * IngestConversationsMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @instance + */ + IngestConversationsMetadata.prototype.endTime = null; + + /** + * IngestConversationsMetadata request. + * @member {google.cloud.contactcenterinsights.v1.IIngestConversationsRequest|null|undefined} request + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @instance + */ + IngestConversationsMetadata.prototype.request = null; + + /** + * IngestConversationsMetadata partialErrors. + * @member {Array.} partialErrors + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @instance + */ + IngestConversationsMetadata.prototype.partialErrors = $util.emptyArray; + + /** + * Creates a new IngestConversationsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsMetadata} IngestConversationsMetadata instance + */ + IngestConversationsMetadata.create = function create(properties) { + return new IngestConversationsMetadata(properties); + }; + + /** + * Encodes the specified IngestConversationsMetadata message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata} message IngestConversationsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestConversationsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.encode(message.request, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.partialErrors != null && message.partialErrors.length) + for (var i = 0; i < message.partialErrors.length; ++i) + $root.google.rpc.Status.encode(message.partialErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngestConversationsMetadata message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata} message IngestConversationsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestConversationsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestConversationsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsMetadata} IngestConversationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestConversationsMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.request = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.partialErrors && message.partialErrors.length)) + message.partialErrors = []; + message.partialErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestConversationsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsMetadata} IngestConversationsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestConversationsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestConversationsMetadata message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestConversationsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.partialErrors != null && message.hasOwnProperty("partialErrors")) { + if (!Array.isArray(message.partialErrors)) + return "partialErrors: array expected"; + for (var i = 0; i < message.partialErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialErrors[i]); + if (error) + return "partialErrors." + error; + } + } + return null; + }; + + /** + * Creates an IngestConversationsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsMetadata} IngestConversationsMetadata + */ + IngestConversationsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.request: object expected"); + message.request = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.fromObject(object.request); + } + if (object.partialErrors) { + if (!Array.isArray(object.partialErrors)) + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.partialErrors: array expected"); + message.partialErrors = []; + for (var i = 0; i < object.partialErrors.length; ++i) { + if (typeof object.partialErrors[i] !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IngestConversationsMetadata.partialErrors: object expected"); + message.partialErrors[i] = $root.google.rpc.Status.fromObject(object.partialErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IngestConversationsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsMetadata} message IngestConversationsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestConversationsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partialErrors = []; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.request = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.cloud.contactcenterinsights.v1.IngestConversationsRequest.toObject(message.request, options); + if (message.partialErrors && message.partialErrors.length) { + object.partialErrors = []; + for (var j = 0; j < message.partialErrors.length; ++j) + object.partialErrors[j] = $root.google.rpc.Status.toObject(message.partialErrors[j], options); + } + return object; + }; + + /** + * Converts this IngestConversationsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @instance + * @returns {Object.} JSON object + */ + IngestConversationsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestConversationsMetadata + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestConversationsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IngestConversationsMetadata"; + }; + + return IngestConversationsMetadata; + })(); + + v1.IngestConversationsResponse = (function() { + + /** + * Properties of an IngestConversationsResponse. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IIngestConversationsResponse + */ + + /** + * Constructs a new IngestConversationsResponse. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents an IngestConversationsResponse. + * @implements IIngestConversationsResponse + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsResponse=} [properties] Properties to set + */ + function IngestConversationsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new IngestConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsResponse} IngestConversationsResponse instance + */ + IngestConversationsResponse.create = function create(properties) { + return new IngestConversationsResponse(properties); + }; + + /** + * Encodes the specified IngestConversationsResponse message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsResponse} message IngestConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified IngestConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IngestConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IIngestConversationsResponse} message IngestConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngestConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngestConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsResponse} IngestConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestConversationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IngestConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngestConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsResponse} IngestConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngestConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngestConversationsResponse message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngestConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an IngestConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.IngestConversationsResponse} IngestConversationsResponse + */ + IngestConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IngestConversationsResponse) + return object; + return new $root.google.cloud.contactcenterinsights.v1.IngestConversationsResponse(); + }; + + /** + * Creates a plain object from an IngestConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsResponse} message IngestConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngestConversationsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this IngestConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + IngestConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngestConversationsResponse + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.IngestConversationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngestConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IngestConversationsResponse"; + }; + + return IngestConversationsResponse; + })(); + + v1.CreateAnalysisRequest = (function() { + + /** + * Properties of a CreateAnalysisRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface ICreateAnalysisRequest + * @property {string|null} [parent] CreateAnalysisRequest parent + * @property {google.cloud.contactcenterinsights.v1.IAnalysis|null} [analysis] CreateAnalysisRequest analysis + */ + + /** + * Constructs a new CreateAnalysisRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a CreateAnalysisRequest. + * @implements ICreateAnalysisRequest + * @constructor + * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest=} [properties] Properties to set + */ + function CreateAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAnalysisRequest parent. + * @member {string} parent + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @instance + */ + CreateAnalysisRequest.prototype.parent = ""; + + /** + * CreateAnalysisRequest analysis. + * @member {google.cloud.contactcenterinsights.v1.IAnalysis|null|undefined} analysis + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @instance + */ + CreateAnalysisRequest.prototype.analysis = null; + + /** + * Creates a new CreateAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest instance + */ + CreateAnalysisRequest.create = function create(properties) { + return new CreateAnalysisRequest(properties); + }; + + /** + * Encodes the specified CreateAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest} message CreateAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.analysis != null && Object.hasOwnProperty.call(message, "analysis")) + $root.google.cloud.contactcenterinsights.v1.Analysis.encode(message.analysis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.ICreateAnalysisRequest} message CreateAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnalysisRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.analysis = $root.google.cloud.contactcenterinsights.v1.Analysis.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAnalysisRequest message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAnalysisRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.analysis != null && message.hasOwnProperty("analysis")) { + var error = $root.google.cloud.contactcenterinsights.v1.Analysis.verify(message.analysis); + if (error) + return "analysis." + error; + } + return null; + }; + + /** + * Creates a CreateAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} CreateAnalysisRequest + */ + CreateAnalysisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.CreateAnalysisRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.analysis != null) { + if (typeof object.analysis !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.CreateAnalysisRequest.analysis: object expected"); + message.analysis = $root.google.cloud.contactcenterinsights.v1.Analysis.fromObject(object.analysis); + } + return message; + }; + + /** + * Creates a plain object from a CreateAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.CreateAnalysisRequest} message CreateAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.analysis = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.analysis != null && message.hasOwnProperty("analysis")) + object.analysis = $root.google.cloud.contactcenterinsights.v1.Analysis.toObject(message.analysis, options); + return object; + }; + + /** + * Converts this CreateAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.CreateAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.CreateAnalysisRequest"; + }; + + return CreateAnalysisRequest; + })(); + + v1.ListAnalysesRequest = (function() { + + /** + * Properties of a ListAnalysesRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IListAnalysesRequest + * @property {string|null} [parent] ListAnalysesRequest parent + * @property {number|null} [pageSize] ListAnalysesRequest pageSize + * @property {string|null} [pageToken] ListAnalysesRequest pageToken + * @property {string|null} [filter] ListAnalysesRequest filter + */ + + /** + * Constructs a new ListAnalysesRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a ListAnalysesRequest. + * @implements IListAnalysesRequest + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest=} [properties] Properties to set + */ + function ListAnalysesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnalysesRequest parent. + * @member {string} parent + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.parent = ""; + + /** + * ListAnalysesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.pageSize = 0; + + /** + * ListAnalysesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.pageToken = ""; + + /** + * ListAnalysesRequest filter. + * @member {string} filter + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @instance + */ + ListAnalysesRequest.prototype.filter = ""; + + /** + * Creates a new ListAnalysesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest instance + */ + ListAnalysesRequest.create = function create(properties) { + return new ListAnalysesRequest(properties); + }; + + /** + * Encodes the specified ListAnalysesRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest} message ListAnalysesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListAnalysesRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest} message ListAnalysesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnalysesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnalysesRequest message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnalysesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListAnalysesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest + */ + ListAnalysesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.ListAnalysesRequest) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListAnalysesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} message ListAnalysesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnalysesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListAnalysesRequest to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnalysesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnalysesRequest + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnalysesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.ListAnalysesRequest"; + }; + + return ListAnalysesRequest; + })(); + + v1.ListAnalysesResponse = (function() { + + /** + * Properties of a ListAnalysesResponse. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IListAnalysesResponse + * @property {Array.|null} [analyses] ListAnalysesResponse analyses + * @property {string|null} [nextPageToken] ListAnalysesResponse nextPageToken + */ + + /** + * Constructs a new ListAnalysesResponse. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a ListAnalysesResponse. + * @implements IListAnalysesResponse + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse=} [properties] Properties to set + */ + function ListAnalysesResponse(properties) { + this.analyses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnalysesResponse analyses. + * @member {Array.} analyses + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @instance + */ + ListAnalysesResponse.prototype.analyses = $util.emptyArray; + + /** + * ListAnalysesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @instance + */ + ListAnalysesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAnalysesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse instance + */ + ListAnalysesResponse.create = function create(properties) { + return new ListAnalysesResponse(properties); + }; + + /** + * Encodes the specified ListAnalysesResponse message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse} message ListAnalysesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyses != null && message.analyses.length) + for (var i = 0; i < message.analyses.length; ++i) + $root.google.cloud.contactcenterinsights.v1.Analysis.encode(message.analyses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAnalysesResponse message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse} message ListAnalysesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnalysesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnalysesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.analyses && message.analyses.length)) + message.analyses = []; + message.analyses.push($root.google.cloud.contactcenterinsights.v1.Analysis.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnalysesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnalysesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnalysesResponse message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnalysesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analyses != null && message.hasOwnProperty("analyses")) { + if (!Array.isArray(message.analyses)) + return "analyses: array expected"; + for (var i = 0; i < message.analyses.length; ++i) { + var error = $root.google.cloud.contactcenterinsights.v1.Analysis.verify(message.analyses[i]); + if (error) + return "analyses." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnalysesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse + */ + ListAnalysesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.ListAnalysesResponse) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesResponse(); + if (object.analyses) { + if (!Array.isArray(object.analyses)) + throw TypeError(".google.cloud.contactcenterinsights.v1.ListAnalysesResponse.analyses: array expected"); + message.analyses = []; + for (var i = 0; i < object.analyses.length; ++i) { + if (typeof object.analyses[i] !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.ListAnalysesResponse.analyses: object expected"); + message.analyses[i] = $root.google.cloud.contactcenterinsights.v1.Analysis.fromObject(object.analyses[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnalysesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} message ListAnalysesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnalysesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.analyses = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.analyses && message.analyses.length) { + object.analyses = []; + for (var j = 0; j < message.analyses.length; ++j) + object.analyses[j] = $root.google.cloud.contactcenterinsights.v1.Analysis.toObject(message.analyses[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnalysesResponse to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnalysesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAnalysesResponse + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAnalysesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.ListAnalysesResponse"; + }; + + return ListAnalysesResponse; + })(); + + v1.GetAnalysisRequest = (function() { + + /** + * Properties of a GetAnalysisRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IGetAnalysisRequest + * @property {string|null} [name] GetAnalysisRequest name + */ + + /** + * Constructs a new GetAnalysisRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a GetAnalysisRequest. + * @implements IGetAnalysisRequest + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest=} [properties] Properties to set + */ + function GetAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnalysisRequest name. + * @member {string} name + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @instance + */ + GetAnalysisRequest.prototype.name = ""; + + /** + * Creates a new GetAnalysisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest instance + */ + GetAnalysisRequest.create = function create(properties) { + return new GetAnalysisRequest(properties); + }; + + /** + * Encodes the specified GetAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.GetAnalysisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest} message GetAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnalysisRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.GetAnalysisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest} message GetAnalysisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnalysisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnalysisRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.GetAnalysisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAnalysisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnalysisRequest message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnalysisRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest + */ + GetAnalysisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.GetAnalysisRequest) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.GetAnalysisRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnalysisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} message GetAnalysisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnalysisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAnalysisRequest to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest * @instance + * @returns {Object.} JSON object + */ + GetAnalysisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnalysisRequest + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.GetAnalysisRequest"; + }; + + return GetAnalysisRequest; + })(); + + v1.DeleteAnalysisRequest = (function() { + + /** + * Properties of a DeleteAnalysisRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IDeleteAnalysisRequest + * @property {string|null} [name] DeleteAnalysisRequest name */ - ListAnalysesRequest.prototype.pageSize = 0; /** - * ListAnalysesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest - * @instance + * Constructs a new DeleteAnalysisRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a DeleteAnalysisRequest. + * @implements IDeleteAnalysisRequest + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest=} [properties] Properties to set */ - ListAnalysesRequest.prototype.pageToken = ""; + function DeleteAnalysisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ListAnalysesRequest filter. - * @member {string} filter - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * DeleteAnalysisRequest name. + * @member {string} name + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @instance */ - ListAnalysesRequest.prototype.filter = ""; + DeleteAnalysisRequest.prototype.name = ""; /** - * Creates a new ListAnalysesRequest instance using the specified properties. + * Creates a new DeleteAnalysisRequest instance using the specified properties. * @function create - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest=} [properties] Properties to set - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest instance + * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest instance */ - ListAnalysesRequest.create = function create(properties) { - return new ListAnalysesRequest(properties); + DeleteAnalysisRequest.create = function create(properties) { + return new DeleteAnalysisRequest(properties); }; /** - * Encodes the specified ListAnalysesRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. + * Encodes the specified DeleteAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest} message ListAnalysesRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest} message DeleteAnalysisRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAnalysesRequest.encode = function encode(message, writer) { + DeleteAnalysisRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListAnalysesRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesRequest.verify|verify} messages. + * Encodes the specified DeleteAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesRequest} message ListAnalysesRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest} message DeleteAnalysisRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAnalysesRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAnalysesRequest message from the specified reader or buffer. + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest + * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAnalysesRequest.decode = function decode(reader, length) { + DeleteAnalysisRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); + message.name = reader.string(); break; } default: @@ -4652,149 +6900,125 @@ }; /** - * Decodes a ListAnalysesRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteAnalysisRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest + * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAnalysesRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAnalysesRequest message. + * Verifies a DeleteAnalysisRequest message. * @function verify - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAnalysesRequest.verify = function verify(message) { + DeleteAnalysisRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListAnalysesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAnalysisRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} ListAnalysesRequest + * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest */ - ListAnalysesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contactcenterinsights.v1.ListAnalysesRequest) + DeleteAnalysisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest) return object; - var message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListAnalysesRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteAnalysisRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static - * @param {google.cloud.contactcenterinsights.v1.ListAnalysesRequest} message ListAnalysesRequest + * @param {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} message DeleteAnalysisRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAnalysesRequest.toObject = function toObject(message, options) { + DeleteAnalysisRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListAnalysesRequest to JSON. + * Converts this DeleteAnalysisRequest to JSON. * @function toJSON - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @instance * @returns {Object.} JSON object */ - ListAnalysesRequest.prototype.toJSON = function toJSON() { + DeleteAnalysisRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListAnalysesRequest + * Gets the default type url for DeleteAnalysisRequest * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListAnalysesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.ListAnalysesRequest"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest"; }; - return ListAnalysesRequest; + return DeleteAnalysisRequest; })(); - v1.ListAnalysesResponse = (function() { + v1.BulkAnalyzeConversationsRequest = (function() { /** - * Properties of a ListAnalysesResponse. + * Properties of a BulkAnalyzeConversationsRequest. * @memberof google.cloud.contactcenterinsights.v1 - * @interface IListAnalysesResponse - * @property {Array.|null} [analyses] ListAnalysesResponse analyses - * @property {string|null} [nextPageToken] ListAnalysesResponse nextPageToken + * @interface IBulkAnalyzeConversationsRequest + * @property {string|null} [parent] BulkAnalyzeConversationsRequest parent + * @property {string|null} [filter] BulkAnalyzeConversationsRequest filter + * @property {number|null} [analysisPercentage] BulkAnalyzeConversationsRequest analysisPercentage + * @property {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null} [annotatorSelector] BulkAnalyzeConversationsRequest annotatorSelector */ /** - * Constructs a new ListAnalysesResponse. + * Constructs a new BulkAnalyzeConversationsRequest. * @memberof google.cloud.contactcenterinsights.v1 - * @classdesc Represents a ListAnalysesResponse. - * @implements IListAnalysesResponse + * @classdesc Represents a BulkAnalyzeConversationsRequest. + * @implements IBulkAnalyzeConversationsRequest * @constructor - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse=} [properties] Properties to set + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest=} [properties] Properties to set */ - function ListAnalysesResponse(properties) { - this.analyses = []; + function BulkAnalyzeConversationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4802,92 +7026,117 @@ } /** - * ListAnalysesResponse analyses. - * @member {Array.} analyses - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * BulkAnalyzeConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @instance */ - ListAnalysesResponse.prototype.analyses = $util.emptyArray; + BulkAnalyzeConversationsRequest.prototype.parent = ""; /** - * ListAnalysesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * BulkAnalyzeConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @instance */ - ListAnalysesResponse.prototype.nextPageToken = ""; + BulkAnalyzeConversationsRequest.prototype.filter = ""; /** - * Creates a new ListAnalysesResponse instance using the specified properties. + * BulkAnalyzeConversationsRequest analysisPercentage. + * @member {number} analysisPercentage + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest + * @instance + */ + BulkAnalyzeConversationsRequest.prototype.analysisPercentage = 0; + + /** + * BulkAnalyzeConversationsRequest annotatorSelector. + * @member {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null|undefined} annotatorSelector + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest + * @instance + */ + BulkAnalyzeConversationsRequest.prototype.annotatorSelector = null; + + /** + * Creates a new BulkAnalyzeConversationsRequest instance using the specified properties. * @function create - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse=} [properties] Properties to set - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse instance + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest} BulkAnalyzeConversationsRequest instance */ - ListAnalysesResponse.create = function create(properties) { - return new ListAnalysesResponse(properties); + BulkAnalyzeConversationsRequest.create = function create(properties) { + return new BulkAnalyzeConversationsRequest(properties); }; /** - * Encodes the specified ListAnalysesResponse message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesResponse.verify|verify} messages. + * Encodes the specified BulkAnalyzeConversationsRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse} message ListAnalysesResponse message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest} message BulkAnalyzeConversationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAnalysesResponse.encode = function encode(message, writer) { + BulkAnalyzeConversationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analyses != null && message.analyses.length) - for (var i = 0; i < message.analyses.length; ++i) - $root.google.cloud.contactcenterinsights.v1.Analysis.encode(message.analyses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.analysisPercentage != null && Object.hasOwnProperty.call(message, "analysisPercentage")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.analysisPercentage); + if (message.annotatorSelector != null && Object.hasOwnProperty.call(message, "annotatorSelector")) + $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.encode(message.annotatorSelector, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListAnalysesResponse message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.ListAnalysesResponse.verify|verify} messages. + * Encodes the specified BulkAnalyzeConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IListAnalysesResponse} message ListAnalysesResponse message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest} message BulkAnalyzeConversationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListAnalysesResponse.encodeDelimited = function encodeDelimited(message, writer) { + BulkAnalyzeConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListAnalysesResponse message from the specified reader or buffer. + * Decodes a BulkAnalyzeConversationsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest} BulkAnalyzeConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAnalysesResponse.decode = function decode(reader, length) { + BulkAnalyzeConversationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.analyses && message.analyses.length)) - message.analyses = []; - message.analyses.push($root.google.cloud.contactcenterinsights.v1.Analysis.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + case 3: { + message.analysisPercentage = reader.float(); break; } - case 2: { - message.nextPageToken = reader.string(); + case 8: { + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.decode(reader, reader.uint32()); break; } default: @@ -4899,148 +7148,157 @@ }; /** - * Decodes a ListAnalysesResponse message from the specified reader or buffer, length delimited. + * Decodes a BulkAnalyzeConversationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest} BulkAnalyzeConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListAnalysesResponse.decodeDelimited = function decodeDelimited(reader) { + BulkAnalyzeConversationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListAnalysesResponse message. + * Verifies a BulkAnalyzeConversationsRequest message. * @function verify - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListAnalysesResponse.verify = function verify(message) { + BulkAnalyzeConversationsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.analyses != null && message.hasOwnProperty("analyses")) { - if (!Array.isArray(message.analyses)) - return "analyses: array expected"; - for (var i = 0; i < message.analyses.length; ++i) { - var error = $root.google.cloud.contactcenterinsights.v1.Analysis.verify(message.analyses[i]); - if (error) - return "analyses." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.analysisPercentage != null && message.hasOwnProperty("analysisPercentage")) + if (typeof message.analysisPercentage !== "number") + return "analysisPercentage: number expected"; + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) { + var error = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify(message.annotatorSelector); + if (error) + return "annotatorSelector." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListAnalysesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BulkAnalyzeConversationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} ListAnalysesResponse + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest} BulkAnalyzeConversationsRequest */ - ListAnalysesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contactcenterinsights.v1.ListAnalysesResponse) + BulkAnalyzeConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest) return object; - var message = new $root.google.cloud.contactcenterinsights.v1.ListAnalysesResponse(); - if (object.analyses) { - if (!Array.isArray(object.analyses)) - throw TypeError(".google.cloud.contactcenterinsights.v1.ListAnalysesResponse.analyses: array expected"); - message.analyses = []; - for (var i = 0; i < object.analyses.length; ++i) { - if (typeof object.analyses[i] !== "object") - throw TypeError(".google.cloud.contactcenterinsights.v1.ListAnalysesResponse.analyses: object expected"); - message.analyses[i] = $root.google.cloud.contactcenterinsights.v1.Analysis.fromObject(object.analyses[i]); - } + var message = new $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.analysisPercentage != null) + message.analysisPercentage = Number(object.analysisPercentage); + if (object.annotatorSelector != null) { + if (typeof object.annotatorSelector !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.annotatorSelector: object expected"); + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.fromObject(object.annotatorSelector); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListAnalysesResponse message. Also converts values to other types if specified. + * Creates a plain object from a BulkAnalyzeConversationsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static - * @param {google.cloud.contactcenterinsights.v1.ListAnalysesResponse} message ListAnalysesResponse + * @param {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest} message BulkAnalyzeConversationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListAnalysesResponse.toObject = function toObject(message, options) { + BulkAnalyzeConversationsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.analyses = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.analyses && message.analyses.length) { - object.analyses = []; - for (var j = 0; j < message.analyses.length; ++j) - object.analyses[j] = $root.google.cloud.contactcenterinsights.v1.Analysis.toObject(message.analyses[j], options); + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.analysisPercentage = 0; + object.annotatorSelector = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.analysisPercentage != null && message.hasOwnProperty("analysisPercentage")) + object.analysisPercentage = options.json && !isFinite(message.analysisPercentage) ? String(message.analysisPercentage) : message.analysisPercentage; + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) + object.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.toObject(message.annotatorSelector, options); return object; }; /** - * Converts this ListAnalysesResponse to JSON. + * Converts this BulkAnalyzeConversationsRequest to JSON. * @function toJSON - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @instance * @returns {Object.} JSON object */ - ListAnalysesResponse.prototype.toJSON = function toJSON() { + BulkAnalyzeConversationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListAnalysesResponse + * Gets the default type url for BulkAnalyzeConversationsRequest * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.ListAnalysesResponse + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListAnalysesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BulkAnalyzeConversationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.ListAnalysesResponse"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest"; }; - return ListAnalysesResponse; + return BulkAnalyzeConversationsRequest; })(); - v1.GetAnalysisRequest = (function() { + v1.BulkAnalyzeConversationsMetadata = (function() { /** - * Properties of a GetAnalysisRequest. + * Properties of a BulkAnalyzeConversationsMetadata. * @memberof google.cloud.contactcenterinsights.v1 - * @interface IGetAnalysisRequest - * @property {string|null} [name] GetAnalysisRequest name + * @interface IBulkAnalyzeConversationsMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] BulkAnalyzeConversationsMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] BulkAnalyzeConversationsMetadata endTime + * @property {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest|null} [request] BulkAnalyzeConversationsMetadata request + * @property {number|null} [completedAnalysesCount] BulkAnalyzeConversationsMetadata completedAnalysesCount + * @property {number|null} [failedAnalysesCount] BulkAnalyzeConversationsMetadata failedAnalysesCount + * @property {number|null} [totalRequestedAnalysesCount] BulkAnalyzeConversationsMetadata totalRequestedAnalysesCount */ /** - * Constructs a new GetAnalysisRequest. + * Constructs a new BulkAnalyzeConversationsMetadata. * @memberof google.cloud.contactcenterinsights.v1 - * @classdesc Represents a GetAnalysisRequest. - * @implements IGetAnalysisRequest + * @classdesc Represents a BulkAnalyzeConversationsMetadata. + * @implements IBulkAnalyzeConversationsMetadata * @constructor - * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest=} [properties] Properties to set + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata=} [properties] Properties to set */ - function GetAnalysisRequest(properties) { + function BulkAnalyzeConversationsMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5048,75 +7306,145 @@ } /** - * GetAnalysisRequest name. - * @member {string} name - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * BulkAnalyzeConversationsMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @instance */ - GetAnalysisRequest.prototype.name = ""; + BulkAnalyzeConversationsMetadata.prototype.createTime = null; /** - * Creates a new GetAnalysisRequest instance using the specified properties. + * BulkAnalyzeConversationsMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + * @instance + */ + BulkAnalyzeConversationsMetadata.prototype.endTime = null; + + /** + * BulkAnalyzeConversationsMetadata request. + * @member {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest|null|undefined} request + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + * @instance + */ + BulkAnalyzeConversationsMetadata.prototype.request = null; + + /** + * BulkAnalyzeConversationsMetadata completedAnalysesCount. + * @member {number} completedAnalysesCount + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + * @instance + */ + BulkAnalyzeConversationsMetadata.prototype.completedAnalysesCount = 0; + + /** + * BulkAnalyzeConversationsMetadata failedAnalysesCount. + * @member {number} failedAnalysesCount + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + * @instance + */ + BulkAnalyzeConversationsMetadata.prototype.failedAnalysesCount = 0; + + /** + * BulkAnalyzeConversationsMetadata totalRequestedAnalysesCount. + * @member {number} totalRequestedAnalysesCount + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + * @instance + */ + BulkAnalyzeConversationsMetadata.prototype.totalRequestedAnalysesCount = 0; + + /** + * Creates a new BulkAnalyzeConversationsMetadata instance using the specified properties. * @function create - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static - * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest=} [properties] Properties to set - * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest instance + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata} BulkAnalyzeConversationsMetadata instance */ - GetAnalysisRequest.create = function create(properties) { - return new GetAnalysisRequest(properties); + BulkAnalyzeConversationsMetadata.create = function create(properties) { + return new BulkAnalyzeConversationsMetadata(properties); }; /** - * Encodes the specified GetAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.GetAnalysisRequest.verify|verify} messages. + * Encodes the specified BulkAnalyzeConversationsMetadata message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static - * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest} message GetAnalysisRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata} message BulkAnalyzeConversationsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAnalysisRequest.encode = function encode(message, writer) { + BulkAnalyzeConversationsMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.encode(message.request, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.completedAnalysesCount != null && Object.hasOwnProperty.call(message, "completedAnalysesCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.completedAnalysesCount); + if (message.failedAnalysesCount != null && Object.hasOwnProperty.call(message, "failedAnalysesCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failedAnalysesCount); + if (message.totalRequestedAnalysesCount != null && Object.hasOwnProperty.call(message, "totalRequestedAnalysesCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.totalRequestedAnalysesCount); return writer; }; /** - * Encodes the specified GetAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.GetAnalysisRequest.verify|verify} messages. + * Encodes the specified BulkAnalyzeConversationsMetadata message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static - * @param {google.cloud.contactcenterinsights.v1.IGetAnalysisRequest} message GetAnalysisRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata} message BulkAnalyzeConversationsMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + BulkAnalyzeConversationsMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetAnalysisRequest message from the specified reader or buffer. + * Decodes a BulkAnalyzeConversationsMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata} BulkAnalyzeConversationsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetAnalysisRequest.decode = function decode(reader, length) { + BulkAnalyzeConversationsMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.GetAnalysisRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.request = $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.decode(reader, reader.uint32()); + break; + } + case 4: { + message.completedAnalysesCount = reader.int32(); + break; + } + case 5: { + message.failedAnalysesCount = reader.int32(); + break; + } + case 6: { + message.totalRequestedAnalysesCount = reader.int32(); break; } default: @@ -5128,122 +7456,179 @@ }; /** - * Decodes a GetAnalysisRequest message from the specified reader or buffer, length delimited. + * Decodes a BulkAnalyzeConversationsMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata} BulkAnalyzeConversationsMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + BulkAnalyzeConversationsMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetAnalysisRequest message. + * Verifies a BulkAnalyzeConversationsMetadata message. * @function verify - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetAnalysisRequest.verify = function verify(message) { + BulkAnalyzeConversationsMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.verify(message.request); + if (error) + return "request." + error; + } + if (message.completedAnalysesCount != null && message.hasOwnProperty("completedAnalysesCount")) + if (!$util.isInteger(message.completedAnalysesCount)) + return "completedAnalysesCount: integer expected"; + if (message.failedAnalysesCount != null && message.hasOwnProperty("failedAnalysesCount")) + if (!$util.isInteger(message.failedAnalysesCount)) + return "failedAnalysesCount: integer expected"; + if (message.totalRequestedAnalysesCount != null && message.hasOwnProperty("totalRequestedAnalysesCount")) + if (!$util.isInteger(message.totalRequestedAnalysesCount)) + return "totalRequestedAnalysesCount: integer expected"; return null; }; /** - * Creates a GetAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BulkAnalyzeConversationsMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} GetAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata} BulkAnalyzeConversationsMetadata */ - GetAnalysisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contactcenterinsights.v1.GetAnalysisRequest) + BulkAnalyzeConversationsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata) return object; - var message = new $root.google.cloud.contactcenterinsights.v1.GetAnalysisRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata.request: object expected"); + message.request = $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.fromObject(object.request); + } + if (object.completedAnalysesCount != null) + message.completedAnalysesCount = object.completedAnalysesCount | 0; + if (object.failedAnalysesCount != null) + message.failedAnalysesCount = object.failedAnalysesCount | 0; + if (object.totalRequestedAnalysesCount != null) + message.totalRequestedAnalysesCount = object.totalRequestedAnalysesCount | 0; return message; }; /** - * Creates a plain object from a GetAnalysisRequest message. Also converts values to other types if specified. + * Creates a plain object from a BulkAnalyzeConversationsMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static - * @param {google.cloud.contactcenterinsights.v1.GetAnalysisRequest} message GetAnalysisRequest + * @param {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata} message BulkAnalyzeConversationsMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetAnalysisRequest.toObject = function toObject(message, options) { + BulkAnalyzeConversationsMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.request = null; + object.completedAnalysesCount = 0; + object.failedAnalysesCount = 0; + object.totalRequestedAnalysesCount = 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest.toObject(message.request, options); + if (message.completedAnalysesCount != null && message.hasOwnProperty("completedAnalysesCount")) + object.completedAnalysesCount = message.completedAnalysesCount; + if (message.failedAnalysesCount != null && message.hasOwnProperty("failedAnalysesCount")) + object.failedAnalysesCount = message.failedAnalysesCount; + if (message.totalRequestedAnalysesCount != null && message.hasOwnProperty("totalRequestedAnalysesCount")) + object.totalRequestedAnalysesCount = message.totalRequestedAnalysesCount; return object; }; /** - * Converts this GetAnalysisRequest to JSON. + * Converts this BulkAnalyzeConversationsMetadata to JSON. * @function toJSON - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @instance * @returns {Object.} JSON object */ - GetAnalysisRequest.prototype.toJSON = function toJSON() { + BulkAnalyzeConversationsMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetAnalysisRequest + * Gets the default type url for BulkAnalyzeConversationsMetadata * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.GetAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BulkAnalyzeConversationsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.GetAnalysisRequest"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata"; }; - return GetAnalysisRequest; + return BulkAnalyzeConversationsMetadata; })(); - v1.DeleteAnalysisRequest = (function() { + v1.BulkAnalyzeConversationsResponse = (function() { /** - * Properties of a DeleteAnalysisRequest. + * Properties of a BulkAnalyzeConversationsResponse. * @memberof google.cloud.contactcenterinsights.v1 - * @interface IDeleteAnalysisRequest - * @property {string|null} [name] DeleteAnalysisRequest name + * @interface IBulkAnalyzeConversationsResponse + * @property {number|null} [successfulAnalysisCount] BulkAnalyzeConversationsResponse successfulAnalysisCount + * @property {number|null} [failedAnalysisCount] BulkAnalyzeConversationsResponse failedAnalysisCount */ /** - * Constructs a new DeleteAnalysisRequest. + * Constructs a new BulkAnalyzeConversationsResponse. * @memberof google.cloud.contactcenterinsights.v1 - * @classdesc Represents a DeleteAnalysisRequest. - * @implements IDeleteAnalysisRequest + * @classdesc Represents a BulkAnalyzeConversationsResponse. + * @implements IBulkAnalyzeConversationsResponse * @constructor - * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest=} [properties] Properties to set + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse=} [properties] Properties to set */ - function DeleteAnalysisRequest(properties) { + function BulkAnalyzeConversationsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5251,75 +7636,89 @@ } /** - * DeleteAnalysisRequest name. - * @member {string} name - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * BulkAnalyzeConversationsResponse successfulAnalysisCount. + * @member {number} successfulAnalysisCount + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @instance */ - DeleteAnalysisRequest.prototype.name = ""; + BulkAnalyzeConversationsResponse.prototype.successfulAnalysisCount = 0; /** - * Creates a new DeleteAnalysisRequest instance using the specified properties. + * BulkAnalyzeConversationsResponse failedAnalysisCount. + * @member {number} failedAnalysisCount + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse + * @instance + */ + BulkAnalyzeConversationsResponse.prototype.failedAnalysisCount = 0; + + /** + * Creates a new BulkAnalyzeConversationsResponse instance using the specified properties. * @function create - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static - * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest=} [properties] Properties to set - * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest instance + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse} BulkAnalyzeConversationsResponse instance */ - DeleteAnalysisRequest.create = function create(properties) { - return new DeleteAnalysisRequest(properties); + BulkAnalyzeConversationsResponse.create = function create(properties) { + return new BulkAnalyzeConversationsResponse(properties); }; /** - * Encodes the specified DeleteAnalysisRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. + * Encodes the specified BulkAnalyzeConversationsResponse message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static - * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest} message DeleteAnalysisRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse} message BulkAnalyzeConversationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAnalysisRequest.encode = function encode(message, writer) { + BulkAnalyzeConversationsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.successfulAnalysisCount != null && Object.hasOwnProperty.call(message, "successfulAnalysisCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.successfulAnalysisCount); + if (message.failedAnalysisCount != null && Object.hasOwnProperty.call(message, "failedAnalysisCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.failedAnalysisCount); return writer; }; /** - * Encodes the specified DeleteAnalysisRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest.verify|verify} messages. + * Encodes the specified BulkAnalyzeConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static - * @param {google.cloud.contactcenterinsights.v1.IDeleteAnalysisRequest} message DeleteAnalysisRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse} message BulkAnalyzeConversationsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAnalysisRequest.encodeDelimited = function encodeDelimited(message, writer) { + BulkAnalyzeConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteAnalysisRequest message from the specified reader or buffer. + * Decodes a BulkAnalyzeConversationsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse} BulkAnalyzeConversationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAnalysisRequest.decode = function decode(reader, length) { + BulkAnalyzeConversationsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.successfulAnalysisCount = reader.int32(); + break; + } + case 2: { + message.failedAnalysisCount = reader.int32(); break; } default: @@ -5331,102 +7730,111 @@ }; /** - * Decodes a DeleteAnalysisRequest message from the specified reader or buffer, length delimited. + * Decodes a BulkAnalyzeConversationsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse} BulkAnalyzeConversationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAnalysisRequest.decodeDelimited = function decodeDelimited(reader) { + BulkAnalyzeConversationsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteAnalysisRequest message. + * Verifies a BulkAnalyzeConversationsResponse message. * @function verify - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteAnalysisRequest.verify = function verify(message) { + BulkAnalyzeConversationsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.successfulAnalysisCount != null && message.hasOwnProperty("successfulAnalysisCount")) + if (!$util.isInteger(message.successfulAnalysisCount)) + return "successfulAnalysisCount: integer expected"; + if (message.failedAnalysisCount != null && message.hasOwnProperty("failedAnalysisCount")) + if (!$util.isInteger(message.failedAnalysisCount)) + return "failedAnalysisCount: integer expected"; return null; }; /** - * Creates a DeleteAnalysisRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BulkAnalyzeConversationsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} DeleteAnalysisRequest + * @returns {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse} BulkAnalyzeConversationsResponse */ - DeleteAnalysisRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest) + BulkAnalyzeConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse) return object; - var message = new $root.google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse(); + if (object.successfulAnalysisCount != null) + message.successfulAnalysisCount = object.successfulAnalysisCount | 0; + if (object.failedAnalysisCount != null) + message.failedAnalysisCount = object.failedAnalysisCount | 0; return message; }; /** - * Creates a plain object from a DeleteAnalysisRequest message. Also converts values to other types if specified. + * Creates a plain object from a BulkAnalyzeConversationsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static - * @param {google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest} message DeleteAnalysisRequest + * @param {google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse} message BulkAnalyzeConversationsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteAnalysisRequest.toObject = function toObject(message, options) { + BulkAnalyzeConversationsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.successfulAnalysisCount = 0; + object.failedAnalysisCount = 0; + } + if (message.successfulAnalysisCount != null && message.hasOwnProperty("successfulAnalysisCount")) + object.successfulAnalysisCount = message.successfulAnalysisCount; + if (message.failedAnalysisCount != null && message.hasOwnProperty("failedAnalysisCount")) + object.failedAnalysisCount = message.failedAnalysisCount; return object; }; /** - * Converts this DeleteAnalysisRequest to JSON. + * Converts this BulkAnalyzeConversationsResponse to JSON. * @function toJSON - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @instance * @returns {Object.} JSON object */ - DeleteAnalysisRequest.prototype.toJSON = function toJSON() { + BulkAnalyzeConversationsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteAnalysisRequest + * Gets the default type url for BulkAnalyzeConversationsResponse * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest + * @memberof google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteAnalysisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BulkAnalyzeConversationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.DeleteAnalysisRequest"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse"; }; - return DeleteAnalysisRequest; + return BulkAnalyzeConversationsResponse; })(); v1.ExportInsightsDataRequest = (function() { @@ -10331,57 +12739,279 @@ * @function encode * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IUpdateIssueRequest} message UpdateIssueRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IUpdateIssueRequest} message UpdateIssueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIssueRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issue != null && Object.hasOwnProperty.call(message, "issue")) + $root.google.cloud.contactcenterinsights.v1.Issue.encode(message.issue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateIssueRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.UpdateIssueRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IUpdateIssueRequest} message UpdateIssueRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIssueRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateIssueRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} UpdateIssueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIssueRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.UpdateIssueRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.issue = $root.google.cloud.contactcenterinsights.v1.Issue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateIssueRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} UpdateIssueRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIssueRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateIssueRequest message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateIssueRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issue != null && message.hasOwnProperty("issue")) { + var error = $root.google.cloud.contactcenterinsights.v1.Issue.verify(message.issue); + if (error) + return "issue." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateIssueRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} UpdateIssueRequest + */ + UpdateIssueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.UpdateIssueRequest) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.UpdateIssueRequest(); + if (object.issue != null) { + if (typeof object.issue !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.UpdateIssueRequest.issue: object expected"); + message.issue = $root.google.cloud.contactcenterinsights.v1.Issue.fromObject(object.issue); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.UpdateIssueRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateIssueRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} message UpdateIssueRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateIssueRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issue = null; + object.updateMask = null; + } + if (message.issue != null && message.hasOwnProperty("issue")) + object.issue = $root.google.cloud.contactcenterinsights.v1.Issue.toObject(message.issue, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateIssueRequest to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateIssueRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateIssueRequest + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateIssueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.UpdateIssueRequest"; + }; + + return UpdateIssueRequest; + })(); + + v1.DeleteIssueRequest = (function() { + + /** + * Properties of a DeleteIssueRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IDeleteIssueRequest + * @property {string|null} [name] DeleteIssueRequest name + */ + + /** + * Constructs a new DeleteIssueRequest. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents a DeleteIssueRequest. + * @implements IDeleteIssueRequest + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IDeleteIssueRequest=} [properties] Properties to set + */ + function DeleteIssueRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteIssueRequest name. + * @member {string} name + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest + * @instance + */ + DeleteIssueRequest.prototype.name = ""; + + /** + * Creates a new DeleteIssueRequest instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IDeleteIssueRequest=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.DeleteIssueRequest} DeleteIssueRequest instance + */ + DeleteIssueRequest.create = function create(properties) { + return new DeleteIssueRequest(properties); + }; + + /** + * Encodes the specified DeleteIssueRequest message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteIssueRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest + * @static + * @param {google.cloud.contactcenterinsights.v1.IDeleteIssueRequest} message DeleteIssueRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateIssueRequest.encode = function encode(message, writer) { + DeleteIssueRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.issue != null && Object.hasOwnProperty.call(message, "issue")) - $root.google.cloud.contactcenterinsights.v1.Issue.encode(message.issue, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateIssueRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.UpdateIssueRequest.verify|verify} messages. + * Encodes the specified DeleteIssueRequest message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.DeleteIssueRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static - * @param {google.cloud.contactcenterinsights.v1.IUpdateIssueRequest} message UpdateIssueRequest message or plain object to encode + * @param {google.cloud.contactcenterinsights.v1.IDeleteIssueRequest} message DeleteIssueRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateIssueRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteIssueRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateIssueRequest message from the specified reader or buffer. + * Decodes a DeleteIssueRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} UpdateIssueRequest + * @returns {google.cloud.contactcenterinsights.v1.DeleteIssueRequest} DeleteIssueRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateIssueRequest.decode = function decode(reader, length) { + DeleteIssueRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.UpdateIssueRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.DeleteIssueRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.issue = $root.google.cloud.contactcenterinsights.v1.Issue.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -10393,121 +13023,102 @@ }; /** - * Decodes an UpdateIssueRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteIssueRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} UpdateIssueRequest + * @returns {google.cloud.contactcenterinsights.v1.DeleteIssueRequest} DeleteIssueRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateIssueRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteIssueRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateIssueRequest message. + * Verifies a DeleteIssueRequest message. * @function verify - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateIssueRequest.verify = function verify(message) { + DeleteIssueRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.issue != null && message.hasOwnProperty("issue")) { - var error = $root.google.cloud.contactcenterinsights.v1.Issue.verify(message.issue); - if (error) - return "issue." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateIssueRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteIssueRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} UpdateIssueRequest + * @returns {google.cloud.contactcenterinsights.v1.DeleteIssueRequest} DeleteIssueRequest */ - UpdateIssueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.contactcenterinsights.v1.UpdateIssueRequest) + DeleteIssueRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.DeleteIssueRequest) return object; - var message = new $root.google.cloud.contactcenterinsights.v1.UpdateIssueRequest(); - if (object.issue != null) { - if (typeof object.issue !== "object") - throw TypeError(".google.cloud.contactcenterinsights.v1.UpdateIssueRequest.issue: object expected"); - message.issue = $root.google.cloud.contactcenterinsights.v1.Issue.fromObject(object.issue); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.contactcenterinsights.v1.UpdateIssueRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.contactcenterinsights.v1.DeleteIssueRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateIssueRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteIssueRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static - * @param {google.cloud.contactcenterinsights.v1.UpdateIssueRequest} message UpdateIssueRequest + * @param {google.cloud.contactcenterinsights.v1.DeleteIssueRequest} message DeleteIssueRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateIssueRequest.toObject = function toObject(message, options) { + DeleteIssueRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.issue = null; - object.updateMask = null; - } - if (message.issue != null && message.hasOwnProperty("issue")) - object.issue = $root.google.cloud.contactcenterinsights.v1.Issue.toObject(message.issue, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateIssueRequest to JSON. + * Converts this DeleteIssueRequest to JSON. * @function toJSON - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @instance * @returns {Object.} JSON object */ - UpdateIssueRequest.prototype.toJSON = function toJSON() { + DeleteIssueRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateIssueRequest + * Gets the default type url for DeleteIssueRequest * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.UpdateIssueRequest + * @memberof google.cloud.contactcenterinsights.v1.DeleteIssueRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateIssueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteIssueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.UpdateIssueRequest"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.DeleteIssueRequest"; }; - return UpdateIssueRequest; + return DeleteIssueRequest; })(); v1.CalculateIssueModelStatsRequest = (function() { @@ -16358,6 +18969,7 @@ * @property {google.protobuf.ITimestamp|null} [requestTime] Analysis requestTime * @property {google.protobuf.ITimestamp|null} [createTime] Analysis createTime * @property {google.cloud.contactcenterinsights.v1.IAnalysisResult|null} [analysisResult] Analysis analysisResult + * @property {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null} [annotatorSelector] Analysis annotatorSelector */ /** @@ -16407,6 +19019,14 @@ */ Analysis.prototype.analysisResult = null; + /** + * Analysis annotatorSelector. + * @member {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null|undefined} annotatorSelector + * @memberof google.cloud.contactcenterinsights.v1.Analysis + * @instance + */ + Analysis.prototype.annotatorSelector = null; + /** * Creates a new Analysis instance using the specified properties. * @function create @@ -16439,6 +19059,8 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.analysisResult != null && Object.hasOwnProperty.call(message, "analysisResult")) $root.google.cloud.contactcenterinsights.v1.AnalysisResult.encode(message.analysisResult, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.annotatorSelector != null && Object.hasOwnProperty.call(message, "annotatorSelector")) + $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.encode(message.annotatorSelector, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -16489,6 +19111,10 @@ message.analysisResult = $root.google.cloud.contactcenterinsights.v1.AnalysisResult.decode(reader, reader.uint32()); break; } + case 8: { + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -16542,6 +19168,11 @@ if (error) return "analysisResult." + error; } + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) { + var error = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify(message.annotatorSelector); + if (error) + return "annotatorSelector." + error; + } return null; }; @@ -16574,6 +19205,11 @@ throw TypeError(".google.cloud.contactcenterinsights.v1.Analysis.analysisResult: object expected"); message.analysisResult = $root.google.cloud.contactcenterinsights.v1.AnalysisResult.fromObject(object.analysisResult); } + if (object.annotatorSelector != null) { + if (typeof object.annotatorSelector !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.Analysis.annotatorSelector: object expected"); + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.fromObject(object.annotatorSelector); + } return message; }; @@ -16595,6 +19231,7 @@ object.requestTime = null; object.createTime = null; object.analysisResult = null; + object.annotatorSelector = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -16604,6 +19241,8 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.analysisResult != null && message.hasOwnProperty("analysisResult")) object.analysisResult = $root.google.cloud.contactcenterinsights.v1.AnalysisResult.toObject(message.analysisResult, options); + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) + object.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.toObject(message.annotatorSelector, options); return object; }; @@ -18844,6 +21483,7 @@ * @property {google.cloud.contactcenterinsights.v1.IEntityMentionData|null} [entityMentionData] CallAnnotation entityMentionData * @property {google.cloud.contactcenterinsights.v1.IIntentMatchData|null} [intentMatchData] CallAnnotation intentMatchData * @property {google.cloud.contactcenterinsights.v1.IPhraseMatchData|null} [phraseMatchData] CallAnnotation phraseMatchData + * @property {google.cloud.contactcenterinsights.v1.IIssueMatchData|null} [issueMatchData] CallAnnotation issueMatchData * @property {number|null} [channelTag] CallAnnotation channelTag * @property {google.cloud.contactcenterinsights.v1.IAnnotationBoundary|null} [annotationStartBoundary] CallAnnotation annotationStartBoundary * @property {google.cloud.contactcenterinsights.v1.IAnnotationBoundary|null} [annotationEndBoundary] CallAnnotation annotationEndBoundary @@ -18920,6 +21560,14 @@ */ CallAnnotation.prototype.phraseMatchData = null; + /** + * CallAnnotation issueMatchData. + * @member {google.cloud.contactcenterinsights.v1.IIssueMatchData|null|undefined} issueMatchData + * @memberof google.cloud.contactcenterinsights.v1.CallAnnotation + * @instance + */ + CallAnnotation.prototype.issueMatchData = null; + /** * CallAnnotation channelTag. * @member {number} channelTag @@ -18949,12 +21597,12 @@ /** * CallAnnotation data. - * @member {"interruptionData"|"sentimentData"|"silenceData"|"holdData"|"entityMentionData"|"intentMatchData"|"phraseMatchData"|undefined} data + * @member {"interruptionData"|"sentimentData"|"silenceData"|"holdData"|"entityMentionData"|"intentMatchData"|"phraseMatchData"|"issueMatchData"|undefined} data * @memberof google.cloud.contactcenterinsights.v1.CallAnnotation * @instance */ Object.defineProperty(CallAnnotation.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["interruptionData", "sentimentData", "silenceData", "holdData", "entityMentionData", "intentMatchData", "phraseMatchData"]), + get: $util.oneOfGetter($oneOfFields = ["interruptionData", "sentimentData", "silenceData", "holdData", "entityMentionData", "intentMatchData", "phraseMatchData", "issueMatchData"]), set: $util.oneOfSetter($oneOfFields) }); @@ -19002,6 +21650,8 @@ $root.google.cloud.contactcenterinsights.v1.IntentMatchData.encode(message.intentMatchData, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); if (message.phraseMatchData != null && Object.hasOwnProperty.call(message, "phraseMatchData")) $root.google.cloud.contactcenterinsights.v1.PhraseMatchData.encode(message.phraseMatchData, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.issueMatchData != null && Object.hasOwnProperty.call(message, "issueMatchData")) + $root.google.cloud.contactcenterinsights.v1.IssueMatchData.encode(message.issueMatchData, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); return writer; }; @@ -19064,6 +21714,10 @@ message.phraseMatchData = $root.google.cloud.contactcenterinsights.v1.PhraseMatchData.decode(reader, reader.uint32()); break; } + case 18: { + message.issueMatchData = $root.google.cloud.contactcenterinsights.v1.IssueMatchData.decode(reader, reader.uint32()); + break; + } case 1: { message.channelTag = reader.int32(); break; @@ -19180,6 +21834,16 @@ return "phraseMatchData." + error; } } + if (message.issueMatchData != null && message.hasOwnProperty("issueMatchData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.contactcenterinsights.v1.IssueMatchData.verify(message.issueMatchData); + if (error) + return "issueMatchData." + error; + } + } if (message.channelTag != null && message.hasOwnProperty("channelTag")) if (!$util.isInteger(message.channelTag)) return "channelTag: integer expected"; @@ -19243,6 +21907,11 @@ throw TypeError(".google.cloud.contactcenterinsights.v1.CallAnnotation.phraseMatchData: object expected"); message.phraseMatchData = $root.google.cloud.contactcenterinsights.v1.PhraseMatchData.fromObject(object.phraseMatchData); } + if (object.issueMatchData != null) { + if (typeof object.issueMatchData !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.CallAnnotation.issueMatchData: object expected"); + message.issueMatchData = $root.google.cloud.contactcenterinsights.v1.IssueMatchData.fromObject(object.issueMatchData); + } if (object.channelTag != null) message.channelTag = object.channelTag | 0; if (object.annotationStartBoundary != null) { @@ -19317,6 +21986,11 @@ if (options.oneofs) object.data = "phraseMatchData"; } + if (message.issueMatchData != null && message.hasOwnProperty("issueMatchData")) { + object.issueMatchData = $root.google.cloud.contactcenterinsights.v1.IssueMatchData.toObject(message.issueMatchData, options); + if (options.oneofs) + object.data = "issueMatchData"; + } return object; }; @@ -21933,19 +24607,227 @@ /** * Gets the default type url for SentimentData * @function getTypeUrl - * @memberof google.cloud.contactcenterinsights.v1.SentimentData + * @memberof google.cloud.contactcenterinsights.v1.SentimentData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SentimentData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.SentimentData"; + }; + + return SentimentData; + })(); + + v1.IssueMatchData = (function() { + + /** + * Properties of an IssueMatchData. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IIssueMatchData + * @property {google.cloud.contactcenterinsights.v1.IIssueAssignment|null} [issueAssignment] IssueMatchData issueAssignment + */ + + /** + * Constructs a new IssueMatchData. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents an IssueMatchData. + * @implements IIssueMatchData + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IIssueMatchData=} [properties] Properties to set + */ + function IssueMatchData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IssueMatchData issueAssignment. + * @member {google.cloud.contactcenterinsights.v1.IIssueAssignment|null|undefined} issueAssignment + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @instance + */ + IssueMatchData.prototype.issueAssignment = null; + + /** + * Creates a new IssueMatchData instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {google.cloud.contactcenterinsights.v1.IIssueMatchData=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.IssueMatchData} IssueMatchData instance + */ + IssueMatchData.create = function create(properties) { + return new IssueMatchData(properties); + }; + + /** + * Encodes the specified IssueMatchData message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IssueMatchData.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {google.cloud.contactcenterinsights.v1.IIssueMatchData} message IssueMatchData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssueMatchData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issueAssignment != null && Object.hasOwnProperty.call(message, "issueAssignment")) + $root.google.cloud.contactcenterinsights.v1.IssueAssignment.encode(message.issueAssignment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IssueMatchData message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.IssueMatchData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {google.cloud.contactcenterinsights.v1.IIssueMatchData} message IssueMatchData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IssueMatchData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IssueMatchData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.IssueMatchData} IssueMatchData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssueMatchData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.IssueMatchData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.issueAssignment = $root.google.cloud.contactcenterinsights.v1.IssueAssignment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IssueMatchData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.IssueMatchData} IssueMatchData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IssueMatchData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IssueMatchData message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IssueMatchData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issueAssignment != null && message.hasOwnProperty("issueAssignment")) { + var error = $root.google.cloud.contactcenterinsights.v1.IssueAssignment.verify(message.issueAssignment); + if (error) + return "issueAssignment." + error; + } + return null; + }; + + /** + * Creates an IssueMatchData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.IssueMatchData} IssueMatchData + */ + IssueMatchData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.IssueMatchData) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.IssueMatchData(); + if (object.issueAssignment != null) { + if (typeof object.issueAssignment !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.IssueMatchData.issueAssignment: object expected"); + message.issueAssignment = $root.google.cloud.contactcenterinsights.v1.IssueAssignment.fromObject(object.issueAssignment); + } + return message; + }; + + /** + * Creates a plain object from an IssueMatchData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @static + * @param {google.cloud.contactcenterinsights.v1.IssueMatchData} message IssueMatchData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IssueMatchData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.issueAssignment = null; + if (message.issueAssignment != null && message.hasOwnProperty("issueAssignment")) + object.issueAssignment = $root.google.cloud.contactcenterinsights.v1.IssueAssignment.toObject(message.issueAssignment, options); + return object; + }; + + /** + * Converts this IssueMatchData to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData + * @instance + * @returns {Object.} JSON object + */ + IssueMatchData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IssueMatchData + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.IssueMatchData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SentimentData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IssueMatchData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.SentimentData"; + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.IssueMatchData"; }; - return SentimentData; + return IssueMatchData; })(); v1.IssueModel = (function() { @@ -22669,6 +25551,7 @@ * @property {string|null} [displayName] Issue displayName * @property {google.protobuf.ITimestamp|null} [createTime] Issue createTime * @property {google.protobuf.ITimestamp|null} [updateTime] Issue updateTime + * @property {Array.|null} [sampleUtterances] Issue sampleUtterances */ /** @@ -22680,6 +25563,7 @@ * @param {google.cloud.contactcenterinsights.v1.IIssue=} [properties] Properties to set */ function Issue(properties) { + this.sampleUtterances = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22718,6 +25602,14 @@ */ Issue.prototype.updateTime = null; + /** + * Issue sampleUtterances. + * @member {Array.} sampleUtterances + * @memberof google.cloud.contactcenterinsights.v1.Issue + * @instance + */ + Issue.prototype.sampleUtterances = $util.emptyArray; + /** * Creates a new Issue instance using the specified properties. * @function create @@ -22750,6 +25642,9 @@ $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sampleUtterances != null && message.sampleUtterances.length) + for (var i = 0; i < message.sampleUtterances.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sampleUtterances[i]); return writer; }; @@ -22800,6 +25695,12 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 6: { + if (!(message.sampleUtterances && message.sampleUtterances.length)) + message.sampleUtterances = []; + message.sampleUtterances.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -22851,6 +25752,13 @@ if (error) return "updateTime." + error; } + if (message.sampleUtterances != null && message.hasOwnProperty("sampleUtterances")) { + if (!Array.isArray(message.sampleUtterances)) + return "sampleUtterances: array expected"; + for (var i = 0; i < message.sampleUtterances.length; ++i) + if (!$util.isString(message.sampleUtterances[i])) + return "sampleUtterances: string[] expected"; + } return null; }; @@ -22880,6 +25788,13 @@ throw TypeError(".google.cloud.contactcenterinsights.v1.Issue.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.sampleUtterances) { + if (!Array.isArray(object.sampleUtterances)) + throw TypeError(".google.cloud.contactcenterinsights.v1.Issue.sampleUtterances: array expected"); + message.sampleUtterances = []; + for (var i = 0; i < object.sampleUtterances.length; ++i) + message.sampleUtterances[i] = String(object.sampleUtterances[i]); + } return message; }; @@ -22896,6 +25811,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.sampleUtterances = []; if (options.defaults) { object.name = ""; object.displayName = ""; @@ -22910,6 +25827,11 @@ object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.sampleUtterances && message.sampleUtterances.length) { + object.sampleUtterances = []; + for (var j = 0; j < message.sampleUtterances.length; ++j) + object.sampleUtterances[j] = message.sampleUtterances[j]; + } return object; }; @@ -25447,6 +28369,7 @@ * @memberof google.cloud.contactcenterinsights.v1.Settings * @interface IAnalysisConfig * @property {number|null} [runtimeIntegrationAnalysisPercentage] AnalysisConfig runtimeIntegrationAnalysisPercentage + * @property {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null} [annotatorSelector] AnalysisConfig annotatorSelector */ /** @@ -25472,6 +28395,14 @@ */ AnalysisConfig.prototype.runtimeIntegrationAnalysisPercentage = 0; + /** + * AnalysisConfig annotatorSelector. + * @member {google.cloud.contactcenterinsights.v1.IAnnotatorSelector|null|undefined} annotatorSelector + * @memberof google.cloud.contactcenterinsights.v1.Settings.AnalysisConfig + * @instance + */ + AnalysisConfig.prototype.annotatorSelector = null; + /** * Creates a new AnalysisConfig instance using the specified properties. * @function create @@ -25498,6 +28429,8 @@ writer = $Writer.create(); if (message.runtimeIntegrationAnalysisPercentage != null && Object.hasOwnProperty.call(message, "runtimeIntegrationAnalysisPercentage")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.runtimeIntegrationAnalysisPercentage); + if (message.annotatorSelector != null && Object.hasOwnProperty.call(message, "annotatorSelector")) + $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.encode(message.annotatorSelector, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -25536,6 +28469,10 @@ message.runtimeIntegrationAnalysisPercentage = reader.double(); break; } + case 5: { + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25574,6 +28511,11 @@ if (message.runtimeIntegrationAnalysisPercentage != null && message.hasOwnProperty("runtimeIntegrationAnalysisPercentage")) if (typeof message.runtimeIntegrationAnalysisPercentage !== "number") return "runtimeIntegrationAnalysisPercentage: number expected"; + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) { + var error = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify(message.annotatorSelector); + if (error) + return "annotatorSelector." + error; + } return null; }; @@ -25591,6 +28533,11 @@ var message = new $root.google.cloud.contactcenterinsights.v1.Settings.AnalysisConfig(); if (object.runtimeIntegrationAnalysisPercentage != null) message.runtimeIntegrationAnalysisPercentage = Number(object.runtimeIntegrationAnalysisPercentage); + if (object.annotatorSelector != null) { + if (typeof object.annotatorSelector !== "object") + throw TypeError(".google.cloud.contactcenterinsights.v1.Settings.AnalysisConfig.annotatorSelector: object expected"); + message.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.fromObject(object.annotatorSelector); + } return message; }; @@ -25607,10 +28554,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.runtimeIntegrationAnalysisPercentage = 0; + object.annotatorSelector = null; + } if (message.runtimeIntegrationAnalysisPercentage != null && message.hasOwnProperty("runtimeIntegrationAnalysisPercentage")) object.runtimeIntegrationAnalysisPercentage = options.json && !isFinite(message.runtimeIntegrationAnalysisPercentage) ? String(message.runtimeIntegrationAnalysisPercentage) : message.runtimeIntegrationAnalysisPercentage; + if (message.annotatorSelector != null && message.hasOwnProperty("annotatorSelector")) + object.annotatorSelector = $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector.toObject(message.annotatorSelector, options); return object; }; @@ -28683,6 +31634,428 @@ return View; })(); + v1.AnnotatorSelector = (function() { + + /** + * Properties of an AnnotatorSelector. + * @memberof google.cloud.contactcenterinsights.v1 + * @interface IAnnotatorSelector + * @property {boolean|null} [runInterruptionAnnotator] AnnotatorSelector runInterruptionAnnotator + * @property {boolean|null} [runSilenceAnnotator] AnnotatorSelector runSilenceAnnotator + * @property {boolean|null} [runPhraseMatcherAnnotator] AnnotatorSelector runPhraseMatcherAnnotator + * @property {Array.|null} [phraseMatchers] AnnotatorSelector phraseMatchers + * @property {boolean|null} [runSentimentAnnotator] AnnotatorSelector runSentimentAnnotator + * @property {boolean|null} [runEntityAnnotator] AnnotatorSelector runEntityAnnotator + * @property {boolean|null} [runIntentAnnotator] AnnotatorSelector runIntentAnnotator + * @property {boolean|null} [runIssueModelAnnotator] AnnotatorSelector runIssueModelAnnotator + * @property {Array.|null} [issueModels] AnnotatorSelector issueModels + */ + + /** + * Constructs a new AnnotatorSelector. + * @memberof google.cloud.contactcenterinsights.v1 + * @classdesc Represents an AnnotatorSelector. + * @implements IAnnotatorSelector + * @constructor + * @param {google.cloud.contactcenterinsights.v1.IAnnotatorSelector=} [properties] Properties to set + */ + function AnnotatorSelector(properties) { + this.phraseMatchers = []; + this.issueModels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotatorSelector runInterruptionAnnotator. + * @member {boolean} runInterruptionAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runInterruptionAnnotator = false; + + /** + * AnnotatorSelector runSilenceAnnotator. + * @member {boolean} runSilenceAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runSilenceAnnotator = false; + + /** + * AnnotatorSelector runPhraseMatcherAnnotator. + * @member {boolean} runPhraseMatcherAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runPhraseMatcherAnnotator = false; + + /** + * AnnotatorSelector phraseMatchers. + * @member {Array.} phraseMatchers + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.phraseMatchers = $util.emptyArray; + + /** + * AnnotatorSelector runSentimentAnnotator. + * @member {boolean} runSentimentAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runSentimentAnnotator = false; + + /** + * AnnotatorSelector runEntityAnnotator. + * @member {boolean} runEntityAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runEntityAnnotator = false; + + /** + * AnnotatorSelector runIntentAnnotator. + * @member {boolean} runIntentAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runIntentAnnotator = false; + + /** + * AnnotatorSelector runIssueModelAnnotator. + * @member {boolean} runIssueModelAnnotator + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.runIssueModelAnnotator = false; + + /** + * AnnotatorSelector issueModels. + * @member {Array.} issueModels + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + */ + AnnotatorSelector.prototype.issueModels = $util.emptyArray; + + /** + * Creates a new AnnotatorSelector instance using the specified properties. + * @function create + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {google.cloud.contactcenterinsights.v1.IAnnotatorSelector=} [properties] Properties to set + * @returns {google.cloud.contactcenterinsights.v1.AnnotatorSelector} AnnotatorSelector instance + */ + AnnotatorSelector.create = function create(properties) { + return new AnnotatorSelector(properties); + }; + + /** + * Encodes the specified AnnotatorSelector message. Does not implicitly {@link google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {google.cloud.contactcenterinsights.v1.IAnnotatorSelector} message AnnotatorSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatorSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runInterruptionAnnotator != null && Object.hasOwnProperty.call(message, "runInterruptionAnnotator")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.runInterruptionAnnotator); + if (message.runSilenceAnnotator != null && Object.hasOwnProperty.call(message, "runSilenceAnnotator")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.runSilenceAnnotator); + if (message.runPhraseMatcherAnnotator != null && Object.hasOwnProperty.call(message, "runPhraseMatcherAnnotator")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.runPhraseMatcherAnnotator); + if (message.phraseMatchers != null && message.phraseMatchers.length) + for (var i = 0; i < message.phraseMatchers.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseMatchers[i]); + if (message.runSentimentAnnotator != null && Object.hasOwnProperty.call(message, "runSentimentAnnotator")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.runSentimentAnnotator); + if (message.runEntityAnnotator != null && Object.hasOwnProperty.call(message, "runEntityAnnotator")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.runEntityAnnotator); + if (message.runIntentAnnotator != null && Object.hasOwnProperty.call(message, "runIntentAnnotator")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.runIntentAnnotator); + if (message.runIssueModelAnnotator != null && Object.hasOwnProperty.call(message, "runIssueModelAnnotator")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.runIssueModelAnnotator); + if (message.issueModels != null && message.issueModels.length) + for (var i = 0; i < message.issueModels.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.issueModels[i]); + return writer; + }; + + /** + * Encodes the specified AnnotatorSelector message, length delimited. Does not implicitly {@link google.cloud.contactcenterinsights.v1.AnnotatorSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {google.cloud.contactcenterinsights.v1.IAnnotatorSelector} message AnnotatorSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatorSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatorSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.contactcenterinsights.v1.AnnotatorSelector} AnnotatorSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatorSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.runInterruptionAnnotator = reader.bool(); + break; + } + case 2: { + message.runSilenceAnnotator = reader.bool(); + break; + } + case 3: { + message.runPhraseMatcherAnnotator = reader.bool(); + break; + } + case 4: { + if (!(message.phraseMatchers && message.phraseMatchers.length)) + message.phraseMatchers = []; + message.phraseMatchers.push(reader.string()); + break; + } + case 5: { + message.runSentimentAnnotator = reader.bool(); + break; + } + case 6: { + message.runEntityAnnotator = reader.bool(); + break; + } + case 7: { + message.runIntentAnnotator = reader.bool(); + break; + } + case 8: { + message.runIssueModelAnnotator = reader.bool(); + break; + } + case 10: { + if (!(message.issueModels && message.issueModels.length)) + message.issueModels = []; + message.issueModels.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatorSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.contactcenterinsights.v1.AnnotatorSelector} AnnotatorSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatorSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatorSelector message. + * @function verify + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatorSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runInterruptionAnnotator != null && message.hasOwnProperty("runInterruptionAnnotator")) + if (typeof message.runInterruptionAnnotator !== "boolean") + return "runInterruptionAnnotator: boolean expected"; + if (message.runSilenceAnnotator != null && message.hasOwnProperty("runSilenceAnnotator")) + if (typeof message.runSilenceAnnotator !== "boolean") + return "runSilenceAnnotator: boolean expected"; + if (message.runPhraseMatcherAnnotator != null && message.hasOwnProperty("runPhraseMatcherAnnotator")) + if (typeof message.runPhraseMatcherAnnotator !== "boolean") + return "runPhraseMatcherAnnotator: boolean expected"; + if (message.phraseMatchers != null && message.hasOwnProperty("phraseMatchers")) { + if (!Array.isArray(message.phraseMatchers)) + return "phraseMatchers: array expected"; + for (var i = 0; i < message.phraseMatchers.length; ++i) + if (!$util.isString(message.phraseMatchers[i])) + return "phraseMatchers: string[] expected"; + } + if (message.runSentimentAnnotator != null && message.hasOwnProperty("runSentimentAnnotator")) + if (typeof message.runSentimentAnnotator !== "boolean") + return "runSentimentAnnotator: boolean expected"; + if (message.runEntityAnnotator != null && message.hasOwnProperty("runEntityAnnotator")) + if (typeof message.runEntityAnnotator !== "boolean") + return "runEntityAnnotator: boolean expected"; + if (message.runIntentAnnotator != null && message.hasOwnProperty("runIntentAnnotator")) + if (typeof message.runIntentAnnotator !== "boolean") + return "runIntentAnnotator: boolean expected"; + if (message.runIssueModelAnnotator != null && message.hasOwnProperty("runIssueModelAnnotator")) + if (typeof message.runIssueModelAnnotator !== "boolean") + return "runIssueModelAnnotator: boolean expected"; + if (message.issueModels != null && message.hasOwnProperty("issueModels")) { + if (!Array.isArray(message.issueModels)) + return "issueModels: array expected"; + for (var i = 0; i < message.issueModels.length; ++i) + if (!$util.isString(message.issueModels[i])) + return "issueModels: string[] expected"; + } + return null; + }; + + /** + * Creates an AnnotatorSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.contactcenterinsights.v1.AnnotatorSelector} AnnotatorSelector + */ + AnnotatorSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector) + return object; + var message = new $root.google.cloud.contactcenterinsights.v1.AnnotatorSelector(); + if (object.runInterruptionAnnotator != null) + message.runInterruptionAnnotator = Boolean(object.runInterruptionAnnotator); + if (object.runSilenceAnnotator != null) + message.runSilenceAnnotator = Boolean(object.runSilenceAnnotator); + if (object.runPhraseMatcherAnnotator != null) + message.runPhraseMatcherAnnotator = Boolean(object.runPhraseMatcherAnnotator); + if (object.phraseMatchers) { + if (!Array.isArray(object.phraseMatchers)) + throw TypeError(".google.cloud.contactcenterinsights.v1.AnnotatorSelector.phraseMatchers: array expected"); + message.phraseMatchers = []; + for (var i = 0; i < object.phraseMatchers.length; ++i) + message.phraseMatchers[i] = String(object.phraseMatchers[i]); + } + if (object.runSentimentAnnotator != null) + message.runSentimentAnnotator = Boolean(object.runSentimentAnnotator); + if (object.runEntityAnnotator != null) + message.runEntityAnnotator = Boolean(object.runEntityAnnotator); + if (object.runIntentAnnotator != null) + message.runIntentAnnotator = Boolean(object.runIntentAnnotator); + if (object.runIssueModelAnnotator != null) + message.runIssueModelAnnotator = Boolean(object.runIssueModelAnnotator); + if (object.issueModels) { + if (!Array.isArray(object.issueModels)) + throw TypeError(".google.cloud.contactcenterinsights.v1.AnnotatorSelector.issueModels: array expected"); + message.issueModels = []; + for (var i = 0; i < object.issueModels.length; ++i) + message.issueModels[i] = String(object.issueModels[i]); + } + return message; + }; + + /** + * Creates a plain object from an AnnotatorSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {google.cloud.contactcenterinsights.v1.AnnotatorSelector} message AnnotatorSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatorSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.phraseMatchers = []; + object.issueModels = []; + } + if (options.defaults) { + object.runInterruptionAnnotator = false; + object.runSilenceAnnotator = false; + object.runPhraseMatcherAnnotator = false; + object.runSentimentAnnotator = false; + object.runEntityAnnotator = false; + object.runIntentAnnotator = false; + object.runIssueModelAnnotator = false; + } + if (message.runInterruptionAnnotator != null && message.hasOwnProperty("runInterruptionAnnotator")) + object.runInterruptionAnnotator = message.runInterruptionAnnotator; + if (message.runSilenceAnnotator != null && message.hasOwnProperty("runSilenceAnnotator")) + object.runSilenceAnnotator = message.runSilenceAnnotator; + if (message.runPhraseMatcherAnnotator != null && message.hasOwnProperty("runPhraseMatcherAnnotator")) + object.runPhraseMatcherAnnotator = message.runPhraseMatcherAnnotator; + if (message.phraseMatchers && message.phraseMatchers.length) { + object.phraseMatchers = []; + for (var j = 0; j < message.phraseMatchers.length; ++j) + object.phraseMatchers[j] = message.phraseMatchers[j]; + } + if (message.runSentimentAnnotator != null && message.hasOwnProperty("runSentimentAnnotator")) + object.runSentimentAnnotator = message.runSentimentAnnotator; + if (message.runEntityAnnotator != null && message.hasOwnProperty("runEntityAnnotator")) + object.runEntityAnnotator = message.runEntityAnnotator; + if (message.runIntentAnnotator != null && message.hasOwnProperty("runIntentAnnotator")) + object.runIntentAnnotator = message.runIntentAnnotator; + if (message.runIssueModelAnnotator != null && message.hasOwnProperty("runIssueModelAnnotator")) + object.runIssueModelAnnotator = message.runIssueModelAnnotator; + if (message.issueModels && message.issueModels.length) { + object.issueModels = []; + for (var j = 0; j < message.issueModels.length; ++j) + object.issueModels[j] = message.issueModels[j]; + } + return object; + }; + + /** + * Converts this AnnotatorSelector to JSON. + * @function toJSON + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @instance + * @returns {Object.} JSON object + */ + AnnotatorSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotatorSelector + * @function getTypeUrl + * @memberof google.cloud.contactcenterinsights.v1.AnnotatorSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotatorSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.contactcenterinsights.v1.AnnotatorSelector"; + }; + + return AnnotatorSelector; + })(); + return v1; })(); diff --git a/packages/google-cloud-contactcenterinsights/protos/protos.json b/packages/google-cloud-contactcenterinsights/protos/protos.json index c22c45509ff..8e9d8399c00 100644 --- a/packages/google-cloud-contactcenterinsights/protos/protos.json +++ b/packages/google-cloud-contactcenterinsights/protos/protos.json @@ -201,6 +201,62 @@ } ] }, + "BulkAnalyzeConversations": { + "requestType": "BulkAnalyzeConversationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/conversations:bulkAnalyze", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,filter,analysis_percentage", + "(google.longrunning.operation_info).response_type": "BulkAnalyzeConversationsResponse", + "(google.longrunning.operation_info).metadata_type": "BulkAnalyzeConversationsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/conversations:bulkAnalyze", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,filter,analysis_percentage" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BulkAnalyzeConversationsResponse", + "metadata_type": "BulkAnalyzeConversationsMetadata" + } + } + ] + }, + "IngestConversations": { + "requestType": "IngestConversationsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/conversations:ingest", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "IngestConversationsResponse", + "(google.longrunning.operation_info).metadata_type": "IngestConversationsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/conversations:ingest", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "IngestConversationsResponse", + "metadata_type": "IngestConversationsMetadata" + } + } + ] + }, "ExportInsightsData": { "requestType": "ExportInsightsDataRequest", "responseType": "google.longrunning.Operation", @@ -451,6 +507,24 @@ } ] }, + "DeleteIssue": { + "requestType": "DeleteIssueRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/issueModels/*/issues/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "CalculateIssueModelStats": { "requestType": "CalculateIssueModelStatsRequest", "responseType": "CalculateIssueModelStatsResponse", @@ -833,6 +907,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY", "(google.api.resource_reference).type": "contactcenterinsights.googleapis.com/Conversation" } + }, + "annotatorSelector": { + "type": "AnnotatorSelector", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -947,6 +1028,110 @@ } } }, + "IngestConversationsRequest": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + }, + "objectConfig": { + "oneof": [ + "transcriptObjectConfig" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 2 + }, + "transcriptObjectConfig": { + "type": "TranscriptObjectConfig", + "id": 3 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "conversationConfig": { + "type": "ConversationConfig", + "id": 4 + } + }, + "nested": { + "GcsSource": { + "fields": { + "bucketUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranscriptObjectConfig": { + "fields": { + "medium": { + "type": "Conversation.Medium", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ConversationConfig": { + "fields": { + "agentId": { + "type": "string", + "id": 1 + } + } + } + } + }, + "IngestConversationsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "request": { + "type": "IngestConversationsRequest", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "partialErrors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "IngestConversationsResponse": { + "fields": {} + }, "CreateAnalysisRequest": { "fields": { "parent": { @@ -1027,6 +1212,76 @@ } } }, + "BulkAnalyzeConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "analysisPercentage": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "annotatorSelector": { + "type": "AnnotatorSelector", + "id": 8 + } + } + }, + "BulkAnalyzeConversationsMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "request": { + "type": "BulkAnalyzeConversationsRequest", + "id": 3 + }, + "completedAnalysesCount": { + "type": "int32", + "id": 4 + }, + "failedAnalysesCount": { + "type": "int32", + "id": 5 + }, + "totalRequestedAnalysesCount": { + "type": "int32", + "id": 6 + } + } + }, + "BulkAnalyzeConversationsResponse": { + "fields": { + "successfulAnalysisCount": { + "type": "int32", + "id": 1 + }, + "failedAnalysisCount": { + "type": "int32", + "id": 2 + } + } + }, "ExportInsightsDataRequest": { "oneofs": { "destination": { @@ -1365,6 +1620,18 @@ } } }, + "DeleteIssueRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "contactcenterinsights.googleapis.com/Issue" + } + } + } + }, "CalculateIssueModelStatsRequest": { "fields": { "issueModel": { @@ -1870,6 +2137,10 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "annotatorSelector": { + "type": "AnnotatorSelector", + "id": 8 } } }, @@ -2034,7 +2305,8 @@ "holdData", "entityMentionData", "intentMatchData", - "phraseMatchData" + "phraseMatchData", + "issueMatchData" ] } }, @@ -2067,6 +2339,10 @@ "type": "PhraseMatchData", "id": 17 }, + "issueMatchData": { + "type": "IssueMatchData", + "id": 18 + }, "channelTag": { "type": "int32", "id": 1 @@ -2230,6 +2506,14 @@ } } }, + "IssueMatchData": { + "fields": { + "issueAssignment": { + "type": "IssueAssignment", + "id": 1 + } + } + }, "IssueModel": { "options": { "(google.api.resource).type": "contactcenterinsights.googleapis.com/IssueModel", @@ -2345,6 +2629,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "sampleUtterances": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -2578,6 +2870,10 @@ "runtimeIntegrationAnalysisPercentage": { "type": "double", "id": 1 + }, + "annotatorSelector": { + "type": "AnnotatorSelector", + "id": 5 } } } @@ -2861,6 +3157,54 @@ "id": 5 } } + }, + "AnnotatorSelector": { + "fields": { + "runInterruptionAnnotator": { + "type": "bool", + "id": 1 + }, + "runSilenceAnnotator": { + "type": "bool", + "id": 2 + }, + "runPhraseMatcherAnnotator": { + "type": "bool", + "id": 3 + }, + "phraseMatchers": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "contactcenterinsights.googleapis.com/PhraseMatcher" + } + }, + "runSentimentAnnotator": { + "type": "bool", + "id": 5 + }, + "runEntityAnnotator": { + "type": "bool", + "id": 6 + }, + "runIntentAnnotator": { + "type": "bool", + "id": 7 + }, + "runIssueModelAnnotator": { + "type": "bool", + "id": 8 + }, + "issueModels": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.resource_reference).type": "contactcenterinsights.googleapis.com/IssueModel" + } + } + } } } } diff --git a/packages/google-cloud-contactcenterinsights/samples/README.md b/packages/google-cloud-contactcenterinsights/samples/README.md index 09c3f771d54..087aceb29cf 100644 --- a/packages/google-cloud-contactcenterinsights/samples/README.md +++ b/packages/google-cloud-contactcenterinsights/samples/README.md @@ -12,6 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Contact_center_insights.bulk_analyze_conversations](#contact_center_insights.bulk_analyze_conversations) * [Contact_center_insights.calculate_issue_model_stats](#contact_center_insights.calculate_issue_model_stats) * [Contact_center_insights.calculate_stats](#contact_center_insights.calculate_stats) * [Contact_center_insights.create_analysis](#contact_center_insights.create_analysis) @@ -21,6 +22,7 @@ * [Contact_center_insights.create_view](#contact_center_insights.create_view) * [Contact_center_insights.delete_analysis](#contact_center_insights.delete_analysis) * [Contact_center_insights.delete_conversation](#contact_center_insights.delete_conversation) + * [Contact_center_insights.delete_issue](#contact_center_insights.delete_issue) * [Contact_center_insights.delete_issue_model](#contact_center_insights.delete_issue_model) * [Contact_center_insights.delete_phrase_matcher](#contact_center_insights.delete_phrase_matcher) * [Contact_center_insights.delete_view](#contact_center_insights.delete_view) @@ -33,6 +35,7 @@ * [Contact_center_insights.get_phrase_matcher](#contact_center_insights.get_phrase_matcher) * [Contact_center_insights.get_settings](#contact_center_insights.get_settings) * [Contact_center_insights.get_view](#contact_center_insights.get_view) + * [Contact_center_insights.ingest_conversations](#contact_center_insights.ingest_conversations) * [Contact_center_insights.list_analyses](#contact_center_insights.list_analyses) * [Contact_center_insights.list_conversations](#contact_center_insights.list_conversations) * [Contact_center_insights.list_issue_models](#contact_center_insights.list_issue_models) @@ -64,6 +67,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Contact_center_insights.bulk_analyze_conversations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js` + + +----- + + + + ### Contact_center_insights.calculate_issue_model_stats View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.calculate_issue_model_stats.js). @@ -217,6 +237,23 @@ __Usage:__ +### Contact_center_insights.delete_issue + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js` + + +----- + + + + ### Contact_center_insights.delete_issue_model View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue_model.js). @@ -421,6 +458,23 @@ __Usage:__ +### Contact_center_insights.ingest_conversations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js` + + +----- + + + + ### Contact_center_insights.list_analyses View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.list_analyses.js). diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js similarity index 100% rename from owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js rename to packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue.js b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js similarity index 100% rename from owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.delete_issue.js rename to packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.delete_issue.js diff --git a/owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.ingest_conversations.js b/packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js similarity index 100% rename from owl-bot-staging/google-cloud-contactcenterinsights/v1/samples/generated/v1/contact_center_insights.ingest_conversations.js rename to packages/google-cloud-contactcenterinsights/samples/generated/v1/contact_center_insights.ingest_conversations.js diff --git a/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json b/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json index f6704aa2812..ad687ee8e67 100644 --- a/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json +++ b/packages/google-cloud-contactcenterinsights/samples/generated/v1/snippet_metadata.google.cloud.contactcenterinsights.v1.json @@ -423,6 +423,110 @@ } } }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async", + "title": "ContactCenterInsights bulkAnalyzeConversations Sample", + "origin": "API_DEFINITION", + "description": " Analyzes multiple conversations in a single request.", + "canonical": true, + "file": "contact_center_insights.bulk_analyze_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BulkAnalyzeConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "analysis_percentage", + "type": "TYPE_FLOAT" + }, + { + "name": "annotator_selector", + "type": ".google.cloud.contactcenterinsights.v1.AnnotatorSelector" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "BulkAnalyzeConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.BulkAnalyzeConversations", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async", + "title": "ContactCenterInsights ingestConversations Sample", + "origin": "API_DEFINITION", + "description": " Imports conversations and processes them according to the user's configuration.", + "canonical": true, + "file": "contact_center_insights.ingest_conversations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "IngestConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversations", + "async": true, + "parameters": [ + { + "name": "gcs_source", + "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource" + }, + { + "name": "transcript_object_config", + "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "conversation_config", + "type": ".google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "IngestConversations", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.IngestConversations", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, { "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_async", "title": "ContactCenterInsights exportInsightsData Sample", @@ -891,6 +995,46 @@ } } }, + { + "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async", + "title": "ContactCenterInsights deleteIssue Sample", + "origin": "API_DEFINITION", + "description": " Deletes an issue.", + "canonical": true, + "file": "contact_center_insights.delete_issue.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssue", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ContactCenterInsightsClient", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsightsClient" + }, + "method": { + "shortName": "DeleteIssue", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights.DeleteIssue", + "service": { + "shortName": "ContactCenterInsights", + "fullName": "google.cloud.contactcenterinsights.v1.ContactCenterInsights" + } + } + } + }, { "regionTag": "contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_async", "title": "ContactCenterInsights calculateIssueModelStats Sample", diff --git a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts index 5c7d5c96dcb..0599b0442f1 100644 --- a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts +++ b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client.ts @@ -124,6 +124,9 @@ export class ContactCenterInsightsClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -265,6 +268,18 @@ export class ContactCenterInsightsClient { const createAnalysisMetadata = protoFilesRoot.lookup( '.google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata' ) as gax.protobuf.Type; + const bulkAnalyzeConversationsResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse' + ) as gax.protobuf.Type; + const bulkAnalyzeConversationsMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata' + ) as gax.protobuf.Type; + const ingestConversationsResponse = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.IngestConversationsResponse' + ) as gax.protobuf.Type; + const ingestConversationsMetadata = protoFilesRoot.lookup( + '.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata' + ) as gax.protobuf.Type; const exportInsightsDataResponse = protoFilesRoot.lookup( '.google.cloud.contactcenterinsights.v1.ExportInsightsDataResponse' ) as gax.protobuf.Type; @@ -302,6 +317,20 @@ export class ContactCenterInsightsClient { createAnalysisResponse.decode.bind(createAnalysisResponse), createAnalysisMetadata.decode.bind(createAnalysisMetadata) ), + bulkAnalyzeConversations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + bulkAnalyzeConversationsResponse.decode.bind( + bulkAnalyzeConversationsResponse + ), + bulkAnalyzeConversationsMetadata.decode.bind( + bulkAnalyzeConversationsMetadata + ) + ), + ingestConversations: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + ingestConversationsResponse.decode.bind(ingestConversationsResponse), + ingestConversationsMetadata.decode.bind(ingestConversationsMetadata) + ), exportInsightsData: new this._gaxModule.LongrunningDescriptor( this.operationsClient, exportInsightsDataResponse.decode.bind(exportInsightsDataResponse), @@ -389,6 +418,8 @@ export class ContactCenterInsightsClient { 'getAnalysis', 'listAnalyses', 'deleteAnalysis', + 'bulkAnalyzeConversations', + 'ingestConversations', 'exportInsightsData', 'createIssueModel', 'updateIssueModel', @@ -400,6 +431,7 @@ export class ContactCenterInsightsClient { 'getIssue', 'listIssues', 'updateIssue', + 'deleteIssue', 'calculateIssueModelStats', 'createPhraseMatcher', 'getPhraseMatcher', @@ -1679,6 +1711,103 @@ export class ContactCenterInsightsClient { this.initialize(); return this.innerApiCalls.updateIssue(request, options, callback); } + /** + * Deletes an issue. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the issue to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.delete_issue.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssue_async + */ + deleteIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest + | undefined + ), + {} | undefined + ] + >; + deleteIssue( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteIssue( + request: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteIssue( + request?: protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.contactcenterinsights.v1.IDeleteIssueRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteIssue(request, options, callback); + } /** * Gets an issue model's statistics. * @@ -3002,6 +3131,301 @@ export class ContactCenterInsightsClient { protos.google.cloud.contactcenterinsights.v1.CreateAnalysisOperationMetadata >; } + /** + * Analyzes multiple conversations in a single request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource to create analyses in. + * @param {string} request.filter + * Required. Filter used to select the subset of conversations to analyze. + * @param {number} request.analysisPercentage + * Required. Percentage of selected conversation to analyze, between + * [0, 100]. + * @param {google.cloud.contactcenterinsights.v1.AnnotatorSelector} request.annotatorSelector + * To select the annotators to run and the phrase matchers to use + * (if any). If not specified, all annotators will be run. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async + */ + bulkAnalyzeConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + bulkAnalyzeConversations( + request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkAnalyzeConversations( + request: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + callback: Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + bulkAnalyzeConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.bulkAnalyzeConversations( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `bulkAnalyzeConversations()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.bulk_analyze_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_BulkAnalyzeConversations_async + */ + async checkBulkAnalyzeConversationsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.bulkAnalyzeConversations, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsMetadata + >; + } + /** + * Imports conversations and processes them according to the user's + * configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.GcsSource} request.gcsSource + * A cloud storage bucket source. + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.TranscriptObjectConfig} request.transcriptObjectConfig + * Configuration for when `source` contains conversation transcripts. + * @param {string} request.parent + * Required. The parent resource for new conversations. + * @param {google.cloud.contactcenterinsights.v1.IngestConversationsRequest.ConversationConfig} request.conversationConfig + * Configuration that applies to all conversations. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.ingest_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async + */ + ingestConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + ingestConversations( + request: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + ingestConversations( + request: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + callback: Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + ingestConversations( + request?: protos.google.cloud.contactcenterinsights.v1.IIngestConversationsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.ingestConversations(request, options, callback); + } + /** + * Check the status of the long running operation returned by `ingestConversations()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/contact_center_insights.ingest_conversations.js + * region_tag:contactcenterinsights_v1_generated_ContactCenterInsights_IngestConversations_async + */ + async checkIngestConversationsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.contactcenterinsights.v1.IngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.ingestConversations, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.contactcenterinsights.v1.IngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IngestConversationsMetadata + >; + } /** * Export insights data to a destination defined in the request body. * diff --git a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client_config.json b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client_config.json index 185d8b39a84..081f19a1212 100644 --- a/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client_config.json +++ b/packages/google-cloud-contactcenterinsights/src/v1/contact_center_insights_client_config.json @@ -77,6 +77,16 @@ "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, + "BulkAnalyzeConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "IngestConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, "ExportInsightsData": { "timeout_millis": 60000, "retry_codes_name": "unavailable", @@ -132,6 +142,11 @@ "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, + "DeleteIssue": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, "CalculateIssueModelStats": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-cloud-contactcenterinsights/src/v1/gapic_metadata.json b/packages/google-cloud-contactcenterinsights/src/v1/gapic_metadata.json index 660ed0a1e33..de8d31be6c2 100644 --- a/packages/google-cloud-contactcenterinsights/src/v1/gapic_metadata.json +++ b/packages/google-cloud-contactcenterinsights/src/v1/gapic_metadata.json @@ -70,6 +70,11 @@ "updateIssue" ] }, + "DeleteIssue": { + "methods": [ + "deleteIssue" + ] + }, "CalculateIssueModelStats": { "methods": [ "calculateIssueModelStats" @@ -135,6 +140,16 @@ "createAnalysis" ] }, + "BulkAnalyzeConversations": { + "methods": [ + "bulkAnalyzeConversations" + ] + }, + "IngestConversations": { + "methods": [ + "ingestConversations" + ] + }, "ExportInsightsData": { "methods": [ "exportInsightsData" @@ -253,6 +268,11 @@ "updateIssue" ] }, + "DeleteIssue": { + "methods": [ + "deleteIssue" + ] + }, "CalculateIssueModelStats": { "methods": [ "calculateIssueModelStats" @@ -318,6 +338,16 @@ "createAnalysis" ] }, + "BulkAnalyzeConversations": { + "methods": [ + "bulkAnalyzeConversations" + ] + }, + "IngestConversations": { + "methods": [ + "ingestConversations" + ] + }, "ExportInsightsData": { "methods": [ "exportInsightsData" diff --git a/packages/google-cloud-contactcenterinsights/test/gapic_contact_center_insights_v1.ts b/packages/google-cloud-contactcenterinsights/test/gapic_contact_center_insights_v1.ts index 3fe31da3776..8c050e65f7a 100644 --- a/packages/google-cloud-contactcenterinsights/test/gapic_contact_center_insights_v1.ts +++ b/packages/google-cloud-contactcenterinsights/test/gapic_contact_center_insights_v1.ts @@ -1887,6 +1887,140 @@ describe('v1.ContactCenterInsightsClient', () => { }); }); + describe('deleteIssue', () => { + it('invokes deleteIssue without error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteIssue = stubSimpleCall(expectedResponse); + const [response] = await client.deleteIssue(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteIssue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIssue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssue without error using callback', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteIssue = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteIssue( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteIssue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIssue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssue with error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIssue = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteIssue(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteIssue as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIssue as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteIssue with closed client', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.DeleteIssueRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.DeleteIssueRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteIssue(request), expectedError); + }); + }); + describe('calculateIssueModelStats', () => { it('invokes calculateIssueModelStats without error', async () => { const client = @@ -3714,6 +3848,410 @@ describe('v1.ContactCenterInsightsClient', () => { }); }); + describe('bulkAnalyzeConversations', () => { + it('invokes bulkAnalyzeConversations without error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkAnalyzeConversations = + stubLongRunningCall(expectedResponse); + const [operation] = await client.bulkAnalyzeConversations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkAnalyzeConversations without error using callback', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.bulkAnalyzeConversations = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkAnalyzeConversations( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IBulkAnalyzeConversationsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkAnalyzeConversations with call error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.bulkAnalyzeConversations(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes bulkAnalyzeConversations with LRO error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.BulkAnalyzeConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkAnalyzeConversations = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.bulkAnalyzeConversations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.bulkAnalyzeConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBulkAnalyzeConversationsProgress without error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkBulkAnalyzeConversationsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBulkAnalyzeConversationsProgress with error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkBulkAnalyzeConversationsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('ingestConversations', () => { + it('invokes ingestConversations without error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.ingestConversations = + stubLongRunningCall(expectedResponse); + const [operation] = await client.ingestConversations(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes ingestConversations without error using callback', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.ingestConversations = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.ingestConversations( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsResponse, + protos.google.cloud.contactcenterinsights.v1.IIngestConversationsMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes ingestConversations with call error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.ingestConversations = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.ingestConversations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes ingestConversations with LRO error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.contactcenterinsights.v1.IngestConversationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.contactcenterinsights.v1.IngestConversationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.ingestConversations = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.ingestConversations(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.ingestConversations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkIngestConversationsProgress without error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkIngestConversationsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkIngestConversationsProgress with error', async () => { + const client = + new contactcenterinsightsModule.v1.ContactCenterInsightsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkIngestConversationsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('exportInsightsData', () => { it('invokes exportInsightsData without error', async () => { const client =